From 3780741116f7ad5f320f7741a22a0bd8a8238621 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 25 Apr 2022 09:00:13 +0800 Subject: [PATCH] Set last user time during drag-and-drop * src/xterm.c (XTmouse_position): Set last user time if track-mouse is drag-source or dropping. --- src/xterm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 4661f731cd0..0f93e4807fc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10717,6 +10717,16 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, #endif /* USE_X_TOOLKIT */ } + /* Set last user time to avoid confusing some window managers + about the tooltip displayed during drag-and-drop. */ + + if ((EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) + && (dpyinfo->last_user_time + < dpyinfo->last_mouse_movement_time)) + x_display_set_last_user_time (dpyinfo, + dpyinfo->last_mouse_movement_time); + if ((!f1 || FRAME_TOOLTIP_P (f1)) && (EQ (track_mouse, Qdropping) || EQ (track_mouse, Qdrag_source)) -- 2.39.2