[haiku-development] [Question] Drag and drop - cancelling active drag/drop session

  • From: Zenja Solaja <solaja@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 17 Jul 2018 05:59:15 +1000

Hi everyone.

I'm working on a native video editor for Haiku, and have a question
regarding how to cancel an active drag-drop session.  From the users point
of view, they can drag any clip either horizontally or vertically.  Simple
repositioning of clips is handled without drag/drop, but eventually the
software figures out a complex move is requested and transitions to a
drag/drop mode.  I'm using the simple Drag'n'Drop protocol via calling
DragMessage(msg, rect).  Until the mouse button is released, the system
draws a rectangle indicating potential drop position.

The problem I have is that I need to cater for the user cancelling a
complex move operation, ie. they revert back to a simple repositioning
mode.  I'd like to cancel the current DragMessage session, or
alternatively, I'd like to remove the visible rectangle drawn by the
system.  Note - the mouse button is still down.

Does anyone know how to cancel an active drag session before MouseUp()?

If this is not possible, then I'd have to implement my own 'drag/drop'
mechanism and bypass the system one (I'd rather not do that).

Other related posts: