Browse Source

XDND: Inform the source widget when DND operation has ended.

tags/v1.3.1000
Jonathan Moore Liles 12 years ago
parent
commit
02768c459a
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      src/fl_dnd_x.cxx

+ 12
- 1
src/fl_dnd_x.cxx View File

@@ -99,6 +99,8 @@ int Fl::dnd() {

XSetSelectionOwner(fl_display, fl_XdndSelection, fl_message_window, fl_event_time);

Fl_Widget *pushed = Fl::pushed();

while (Fl::pushed()) {

// figure out what window we are pointing at:
@@ -178,8 +180,10 @@ int Fl::dnd() {
fl_i_own_selection[0] = 1;
if (local_handle(FL_DND_RELEASE, local_window)) paste(*belowmouse(), 0);
} else if (dndversion) {
fl_sendClientMessage(target_window, fl_XdndDrop, source_window,

fl_sendClientMessage(target_window, fl_XdndDrop, source_window,
0, fl_event_time);
} else if (target_window) {
// fake a drop by clicking the middle mouse button:
XButtonEvent msg;
@@ -201,6 +205,13 @@ int Fl::dnd() {
XSendEvent(fl_display, target_window, False, 0L, (XEvent*)&msg);
}

if ( !local_window )
{
/* let the source widget know that DND is over */
pushed->handle( FL_DND_RELEASE );
pushed->handle( FL_RELEASE );
}

fl_local_grab = 0;
source_fl_win->cursor(FL_CURSOR_DEFAULT);
return 1;


Loading…
Cancel
Save