happened inside the drag_and_drop event loop. */
static bool x_dnd_inside_handle_one_xevent;
+/* The recursive edit depth when the drag-and-drop operation was
+ started. */
+static int x_dnd_recursion_depth;
+
/* Structure describing a single window that can be the target of
drag-and-drop operations. */
struct x_client_list_window
#endif
x_dnd_in_progress = true;
+ x_dnd_recursion_depth = command_loop_level + minibuf_level;
x_dnd_frame = f;
x_dnd_last_seen_window = None;
x_dnd_last_seen_toplevel = None;
f = mouse_or_wdesc_frame (dpyinfo, event->xmotion.window);
if (x_dnd_in_progress
+ /* Handle these events normally if the recursion
+ level is higher than when the drag-and-drop
+ operation was initiated. This is so that mouse
+ input works while we're in the debugger for, say,
+ `x-dnd-movement-function`. */
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth)
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
Window target, toplevel;
bool dnd_grab = false;
if (x_dnd_in_progress
+ /* Handle these events normally if the recursion
+ level is higher than when the drag-and-drop
+ operation was initiated. This is so that mouse
+ input works while we're in the debugger for, say,
+ `x-dnd-movement-function`. */
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth)
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
if (event->xbutton.type == ButtonPress
goto OTHER;
}
- if (x_dnd_in_progress)
+ if (x_dnd_in_progress
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth))
goto OTHER;
memset (&compose_status, 0, sizeof (compose_status));
f = mouse_or_wdesc_frame (dpyinfo, xev->event);
if (x_dnd_in_progress
+ /* Handle these events normally if the recursion
+ level is higher than when the drag-and-drop
+ operation was initiated. This is so that mouse
+ input works while we're in the debugger for, say,
+ `x-dnd-movement-function`. */
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth)
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
Window target, toplevel;
int dnd_state;
if (x_dnd_in_progress
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth)
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
if (xev->evtype == XI_ButtonPress
}
}
- if (x_dnd_in_progress)
+ if (x_dnd_in_progress
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth))
goto XI_OTHER;
#ifdef USE_MOTIF