x_dnd_in_progress = false;
x_dnd_frame = NULL;
+ x_set_dnd_targets (NULL, 0);
}
FRAME_DISPLAY_INFO (f)->grabbed = 0;
}
}
+ x_set_dnd_targets (NULL, 0);
+
#ifdef USE_GTK
current_hold_quit = NULL;
#endif
bool tool_bar_p = false;
bool dnd_grab = false;
- for (int i = 1; i < 8; ++i)
- {
- if (i != event->xbutton.button
- && event->xbutton.state & (Button1Mask << (i - 1)))
- dnd_grab = true;
- }
-
if (x_dnd_in_progress
- && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame)
- && !dnd_grab
- && event->xbutton.type == ButtonRelease)
+ && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
- x_dnd_in_progress = false;
+ for (int i = 1; i < 8; ++i)
+ {
+ if (i != event->xbutton.button
+ && event->xbutton.state & (Button1Mask << (i - 1)))
+ dnd_grab = true;
+ }
- if (x_dnd_last_seen_window != None
- && x_dnd_last_protocol_version != -1)
- x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
- x_dnd_selection_timestamp,
- x_dnd_last_protocol_version);
+ if (dnd_grab && event->xbutton.type == ButtonRelease)
+ {
+ x_dnd_in_progress = false;
+
+ if (x_dnd_last_seen_window != None
+ && x_dnd_last_protocol_version != -1)
+ x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_selection_timestamp,
+ x_dnd_last_protocol_version);
- x_dnd_last_protocol_version = -1;
- x_dnd_last_seen_window = None;
- x_dnd_frame = NULL;
- x_set_dnd_targets (NULL, 0);
+ x_dnd_last_protocol_version = -1;
+ x_dnd_last_seen_window = None;
+ x_dnd_frame = NULL;
+ x_set_dnd_targets (NULL, 0);
+ }
goto OTHER;
}
XButtonEvent bv;
bool dnd_grab = false;
- for (int i = 0; i < xev->buttons.mask_len * 8; ++i)
- {
- if (i != xev->detail && XIMaskIsSet (xev->buttons.mask, i))
- dnd_grab = true;
- }
-
if (x_dnd_in_progress
- && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame)
- && !dnd_grab
- && xev->evtype == XI_ButtonRelease)
+ && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
- x_dnd_in_progress = false;
+ for (int i = 0; i < xev->buttons.mask_len * 8; ++i)
+ {
+ if (i != xev->detail && XIMaskIsSet (xev->buttons.mask, i))
+ dnd_grab = true;
+ }
- if (x_dnd_last_seen_window != None
- && x_dnd_last_protocol_version != -1)
- x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
- x_dnd_selection_timestamp,
- x_dnd_last_protocol_version);
+ if (!dnd_grab
+ && xev->evtype == XI_ButtonRelease)
+ {
+ x_dnd_in_progress = false;
- x_dnd_last_protocol_version = -1;
- x_dnd_last_seen_window = None;
- x_dnd_frame = NULL;
- x_set_dnd_targets (NULL, 0);
+ if (x_dnd_last_seen_window != None
+ && x_dnd_last_protocol_version != -1)
+ x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_selection_timestamp,
+ x_dnd_last_protocol_version);
- goto XI_OTHER;
+ x_dnd_last_protocol_version = -1;
+ x_dnd_last_seen_window = None;
+ x_dnd_frame = NULL;
+ x_set_dnd_targets (NULL, 0);
+
+ goto XI_OTHER;
+ }
}
if (x_dnd_in_progress)