aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-27 15:51:41 +0800
committerPo Lu2022-03-27 15:53:56 +0800
commit9f43549cdfaeb26392f6b99524ae35c4101d0eb7 (patch)
tree4a01e0921aa18e274f41ede6ec8663cd36b4491e /src
parentd361144f61198fbc914472d6e0714371178b33ec (diff)
downloademacs-9f43549cdfaeb26392f6b99524ae35c4101d0eb7.tar.gz
emacs-9f43549cdfaeb26392f6b99524ae35c4101d0eb7.zip
Don't wait for XdndFinished messages if the target did not send status
* src/xterm.c (x_dnd_send_leave): Return if we should wait for a XdndFinished message. (handle_one_xevent): Use that value for `x_dnd_waiting_for_finish'.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 099b992d083..a77b90a4b5c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1785,7 +1785,7 @@ x_dnd_send_leave (struct frame *f, Window target)
1785 x_uncatch_errors (); 1785 x_uncatch_errors ();
1786} 1786}
1787 1787
1788static void 1788static bool
1789x_dnd_send_drop (struct frame *f, Window target, Time timestamp, 1789x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
1790 int supported) 1790 int supported)
1791{ 1791{
@@ -1824,7 +1824,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
1824 x_dnd_n_targets, atom_names)) 1824 x_dnd_n_targets, atom_names))
1825 { 1825 {
1826 XFree (name); 1826 XFree (name);
1827 return; 1827 return false;
1828 } 1828 }
1829 1829
1830 for (i = x_dnd_n_targets; i != 0; --i) 1830 for (i = x_dnd_n_targets; i != 0; --i)
@@ -1844,9 +1844,14 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
1844 XFree (name); 1844 XFree (name);
1845 kbd_buffer_store_event (&ie); 1845 kbd_buffer_store_event (&ie);
1846 1846
1847 return; 1847 return false;
1848 } 1848 }
1849 } 1849 }
1850 else if (x_dnd_action == None)
1851 {
1852 x_dnd_send_leave (f, target);
1853 return false;
1854 }
1850 1855
1851 msg.xclient.type = ClientMessage; 1856 msg.xclient.type = ClientMessage;
1852 msg.xclient.message_type = dpyinfo->Xatom_XdndDrop; 1857 msg.xclient.message_type = dpyinfo->Xatom_XdndDrop;
@@ -1864,6 +1869,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
1864 x_catch_errors (dpyinfo->display); 1869 x_catch_errors (dpyinfo->display);
1865 XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg); 1870 XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg);
1866 x_uncatch_errors (); 1871 x_uncatch_errors ();
1872 return true;
1867} 1873}
1868 1874
1869void 1875void
@@ -13451,16 +13457,13 @@ handle_one_xevent (struct x_display_info *dpyinfo,
13451 if (x_dnd_last_seen_window != None 13457 if (x_dnd_last_seen_window != None
13452 && x_dnd_last_protocol_version != -1) 13458 && x_dnd_last_protocol_version != -1)
13453 { 13459 {
13454 /* Crazy hack to make dragging from one frame to
13455 another work. */
13456 x_dnd_waiting_for_finish = !x_any_window_to_frame (dpyinfo,
13457 x_dnd_last_seen_window);
13458 x_dnd_pending_finish_target = x_dnd_last_seen_window; 13460 x_dnd_pending_finish_target = x_dnd_last_seen_window;
13459 x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; 13461 x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version;
13460 13462
13461 x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window, 13463 x_dnd_waiting_for_finish
13462 x_dnd_selection_timestamp, 13464 = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
13463 x_dnd_last_protocol_version); 13465 x_dnd_selection_timestamp,
13466 x_dnd_last_protocol_version);
13464 } 13467 }
13465 13468
13466 x_dnd_last_protocol_version = -1; 13469 x_dnd_last_protocol_version = -1;
@@ -14453,14 +14456,13 @@ handle_one_xevent (struct x_display_info *dpyinfo,
14453 if (x_dnd_last_seen_window != None 14456 if (x_dnd_last_seen_window != None
14454 && x_dnd_last_protocol_version != -1) 14457 && x_dnd_last_protocol_version != -1)
14455 { 14458 {
14456 x_dnd_waiting_for_finish = !x_any_window_to_frame (dpyinfo,
14457 x_dnd_last_seen_window);
14458 x_dnd_pending_finish_target = x_dnd_last_seen_window; 14459 x_dnd_pending_finish_target = x_dnd_last_seen_window;
14459 x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; 14460 x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version;
14460 14461
14461 x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window, 14462 x_dnd_waiting_for_finish
14462 x_dnd_selection_timestamp, 14463 = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
14463 x_dnd_last_protocol_version); 14464 x_dnd_selection_timestamp,
14465 x_dnd_last_protocol_version);
14464 } 14466 }
14465 14467
14466 x_dnd_last_protocol_version = -1; 14468 x_dnd_last_protocol_version = -1;