aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-09-10 18:49:53 +0800
committerPo Lu2022-09-10 18:51:13 +0800
commit2a1608a960b56ce991050c5f87c1261e330aeca2 (patch)
treec49276a40441e397b73dd207ddfefe8bba7e0651 /src
parent433fc8bebfef40130bf62f17e5349560b62e566e (diff)
downloademacs-2a1608a960b56ce991050c5f87c1261e330aeca2.tar.gz
emacs-2a1608a960b56ce991050c5f87c1261e330aeca2.zip
Fix compliance with the XDND specification when dropping on a proxy
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position) (x_dnd_send_leave, x_dnd_send_drop, x_dnd_do_drop): New parameter `toplevel'. Use it as the window in sent client messages. (x_dnd_cancel_dnd_early, x_dnd_cleanup_drag_and_drop) (x_dnd_process_quit, x_dnd_update_state, handle_one_xevent) (x_connection_closed): Give the right toplevel to the client message sending functions.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c79
1 files changed, 51 insertions, 28 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 6043e2ab09a..4ac42a91384 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4455,7 +4455,8 @@ x_dnd_get_window_proto (struct x_display_info *dpyinfo, Window wdesc)
4455} 4455}
4456 4456
4457static void 4457static void
4458x_dnd_send_enter (struct frame *f, Window target, int supported) 4458x_dnd_send_enter (struct frame *f, Window target, Window toplevel,
4459 int supported)
4459{ 4460{
4460 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 4461 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
4461 int i; 4462 int i;
@@ -4464,7 +4465,7 @@ x_dnd_send_enter (struct frame *f, Window target, int supported)
4464 msg.xclient.type = ClientMessage; 4465 msg.xclient.type = ClientMessage;
4465 msg.xclient.message_type = dpyinfo->Xatom_XdndEnter; 4466 msg.xclient.message_type = dpyinfo->Xatom_XdndEnter;
4466 msg.xclient.format = 32; 4467 msg.xclient.format = 32;
4467 msg.xclient.window = target; 4468 msg.xclient.window = toplevel;
4468 msg.xclient.data.l[0] = FRAME_X_WINDOW (f); 4469 msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
4469 msg.xclient.data.l[1] = (((unsigned int) min (X_DND_SUPPORTED_VERSION, 4470 msg.xclient.data.l[1] = (((unsigned int) min (X_DND_SUPPORTED_VERSION,
4470 supported) << 24) 4471 supported) << 24)
@@ -4492,10 +4493,10 @@ x_dnd_send_enter (struct frame *f, Window target, int supported)
4492} 4493}
4493 4494
4494static void 4495static void
4495x_dnd_send_position (struct frame *f, Window target, int supported, 4496x_dnd_send_position (struct frame *f, Window target, Window toplevel,
4496 unsigned short root_x, unsigned short root_y, 4497 int supported, unsigned short root_x,
4497 Time timestamp, Atom action, int button, 4498 unsigned short root_y, Time timestamp, Atom action,
4498 unsigned state) 4499 int button, unsigned state)
4499{ 4500{
4500 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 4501 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
4501 XEvent msg; 4502 XEvent msg;
@@ -4503,7 +4504,7 @@ x_dnd_send_position (struct frame *f, Window target, int supported,
4503 msg.xclient.type = ClientMessage; 4504 msg.xclient.type = ClientMessage;
4504 msg.xclient.message_type = dpyinfo->Xatom_XdndPosition; 4505 msg.xclient.message_type = dpyinfo->Xatom_XdndPosition;
4505 msg.xclient.format = 32; 4506 msg.xclient.format = 32;
4506 msg.xclient.window = target; 4507 msg.xclient.window = toplevel;
4507 msg.xclient.data.l[0] = FRAME_X_WINDOW (f); 4508 msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
4508 msg.xclient.data.l[1] = 0; 4509 msg.xclient.data.l[1] = 0;
4509 4510
@@ -4567,7 +4568,7 @@ x_dnd_send_position (struct frame *f, Window target, int supported,
4567} 4568}
4568 4569
4569static void 4570static void
4570x_dnd_send_leave (struct frame *f, Window target) 4571x_dnd_send_leave (struct frame *f, Window target, Window toplevel)
4571{ 4572{
4572 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 4573 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
4573 XEvent msg; 4574 XEvent msg;
@@ -4575,7 +4576,7 @@ x_dnd_send_leave (struct frame *f, Window target)
4575 msg.xclient.type = ClientMessage; 4576 msg.xclient.type = ClientMessage;
4576 msg.xclient.message_type = dpyinfo->Xatom_XdndLeave; 4577 msg.xclient.message_type = dpyinfo->Xatom_XdndLeave;
4577 msg.xclient.format = 32; 4578 msg.xclient.format = 32;
4578 msg.xclient.window = target; 4579 msg.xclient.window = toplevel;
4579 msg.xclient.data.l[0] = FRAME_X_WINDOW (f); 4580 msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
4580 msg.xclient.data.l[1] = 0; 4581 msg.xclient.data.l[1] = 0;
4581 msg.xclient.data.l[2] = 0; 4582 msg.xclient.data.l[2] = 0;
@@ -4591,15 +4592,15 @@ x_dnd_send_leave (struct frame *f, Window target)
4591} 4592}
4592 4593
4593static bool 4594static bool
4594x_dnd_send_drop (struct frame *f, Window target, Time timestamp, 4595x_dnd_send_drop (struct frame *f, Window target, Window toplevel,
4595 int supported) 4596 Time timestamp, int supported)
4596{ 4597{
4597 struct x_display_info *dpyinfo; 4598 struct x_display_info *dpyinfo;
4598 XEvent msg; 4599 XEvent msg;
4599 4600
4600 if (x_dnd_action == None) 4601 if (x_dnd_action == None)
4601 { 4602 {
4602 x_dnd_send_leave (f, target); 4603 x_dnd_send_leave (f, target, toplevel);
4603 return false; 4604 return false;
4604 } 4605 }
4605 4606
@@ -4608,7 +4609,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
4608 msg.xclient.type = ClientMessage; 4609 msg.xclient.type = ClientMessage;
4609 msg.xclient.message_type = dpyinfo->Xatom_XdndDrop; 4610 msg.xclient.message_type = dpyinfo->Xatom_XdndDrop;
4610 msg.xclient.format = 32; 4611 msg.xclient.format = 32;
4611 msg.xclient.window = target; 4612 msg.xclient.window = toplevel;
4612 msg.xclient.data.l[0] = FRAME_X_WINDOW (f); 4613 msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
4613 msg.xclient.data.l[1] = 0; 4614 msg.xclient.data.l[1] = 0;
4614 msg.xclient.data.l[2] = 0; 4615 msg.xclient.data.l[2] = 0;
@@ -4625,10 +4626,10 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
4625} 4626}
4626 4627
4627static bool 4628static bool
4628x_dnd_do_drop (Window target, int supported) 4629x_dnd_do_drop (Window target, Window toplevel, int supported)
4629{ 4630{
4630 if (x_dnd_waiting_for_status_window != target) 4631 if (x_dnd_waiting_for_status_window != target)
4631 return x_dnd_send_drop (x_dnd_frame, target, 4632 return x_dnd_send_drop (x_dnd_frame, target, toplevel,
4632 x_dnd_selection_timestamp, supported); 4633 x_dnd_selection_timestamp, supported);
4633 4634
4634 x_dnd_need_send_drop = true; 4635 x_dnd_need_send_drop = true;
@@ -4733,7 +4734,8 @@ x_dnd_cancel_dnd_early (void)
4733 if (x_dnd_last_seen_window != None 4734 if (x_dnd_last_seen_window != None
4734 && x_dnd_last_protocol_version != -1) 4735 && x_dnd_last_protocol_version != -1)
4735 x_dnd_send_leave (x_dnd_frame, 4736 x_dnd_send_leave (x_dnd_frame,
4736 x_dnd_last_seen_window); 4737 x_dnd_last_seen_window,
4738 x_dnd_last_seen_toplevel);
4737 else if (x_dnd_last_seen_window != None 4739 else if (x_dnd_last_seen_window != None
4738 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style) 4740 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
4739 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE 4741 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
@@ -4791,7 +4793,8 @@ x_dnd_cleanup_drag_and_drop (void *frame)
4791 if (x_dnd_last_seen_window != None 4793 if (x_dnd_last_seen_window != None
4792 && x_dnd_last_protocol_version != -1) 4794 && x_dnd_last_protocol_version != -1)
4793 x_dnd_send_leave (x_dnd_frame, 4795 x_dnd_send_leave (x_dnd_frame,
4794 x_dnd_last_seen_window); 4796 x_dnd_last_seen_window,
4797 x_dnd_last_seen_toplevel);
4795 else if (x_dnd_last_seen_window != None 4798 else if (x_dnd_last_seen_window != None
4796 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style) 4799 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
4797 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE 4800 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
@@ -11912,7 +11915,8 @@ x_dnd_process_quit (struct frame *f, Time timestamp)
11912 { 11915 {
11913 if (x_dnd_last_seen_window != None 11916 if (x_dnd_last_seen_window != None
11914 && x_dnd_last_protocol_version != -1) 11917 && x_dnd_last_protocol_version != -1)
11915 x_dnd_send_leave (f, x_dnd_last_seen_window); 11918 x_dnd_send_leave (f, x_dnd_last_seen_window,
11919 x_dnd_last_seen_toplevel);
11916 else if (x_dnd_last_seen_window != None 11920 else if (x_dnd_last_seen_window != None
11917 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style) 11921 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
11918 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE 11922 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
@@ -17107,7 +17111,8 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
17107 if (x_dnd_last_seen_window != None 17111 if (x_dnd_last_seen_window != None
17108 && x_dnd_last_protocol_version != -1 17112 && x_dnd_last_protocol_version != -1
17109 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)) 17113 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
17110 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window); 17114 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
17115 x_dnd_last_seen_toplevel);
17111 else if (x_dnd_last_seen_window != None 17116 else if (x_dnd_last_seen_window != None
17112 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 17117 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
17113 && !x_dnd_disable_motif_drag 17118 && !x_dnd_disable_motif_drag
@@ -17147,7 +17152,8 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
17147 if (x_dnd_last_seen_window != None 17152 if (x_dnd_last_seen_window != None
17148 && x_dnd_last_protocol_version != -1 17153 && x_dnd_last_protocol_version != -1
17149 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)) 17154 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
17150 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window); 17155 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
17156 x_dnd_last_seen_toplevel);
17151 else if (x_dnd_last_seen_window != None 17157 else if (x_dnd_last_seen_window != None
17152 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 17158 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
17153 && !x_dnd_disable_motif_drag 17159 && !x_dnd_disable_motif_drag
@@ -17175,7 +17181,7 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
17175 x_dnd_last_window_is_frame = was_frame; 17181 x_dnd_last_window_is_frame = was_frame;
17176 17182
17177 if (target != None && x_dnd_last_protocol_version != -1) 17183 if (target != None && x_dnd_last_protocol_version != -1)
17178 x_dnd_send_enter (x_dnd_frame, target, 17184 x_dnd_send_enter (x_dnd_frame, target, x_dnd_last_seen_toplevel,
17179 x_dnd_last_protocol_version); 17185 x_dnd_last_protocol_version);
17180 else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 17186 else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
17181 && !x_dnd_disable_motif_drag) 17187 && !x_dnd_disable_motif_drag)
@@ -17201,6 +17207,7 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
17201 x_dnd_note_self_position (dpyinfo, target, root_x, root_y); 17207 x_dnd_note_self_position (dpyinfo, target, root_x, root_y);
17202 else if (x_dnd_last_protocol_version != -1 && target != None) 17208 else if (x_dnd_last_protocol_version != -1 && target != None)
17203 x_dnd_send_position (x_dnd_frame, target, 17209 x_dnd_send_position (x_dnd_frame, target,
17210 x_dnd_last_seen_toplevel,
17204 x_dnd_last_protocol_version, 17211 x_dnd_last_protocol_version,
17205 root_x, root_y, 17212 root_x, root_y,
17206 x_dnd_selection_timestamp, 17213 x_dnd_selection_timestamp,
@@ -17244,7 +17251,8 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
17244 if (x_dnd_last_seen_window != None 17251 if (x_dnd_last_seen_window != None
17245 && x_dnd_last_protocol_version != -1) 17252 && x_dnd_last_protocol_version != -1)
17246 x_dnd_send_leave (x_dnd_frame, 17253 x_dnd_send_leave (x_dnd_frame,
17247 x_dnd_last_seen_window); 17254 x_dnd_last_seen_window,
17255 x_dnd_last_seen_toplevel);
17248 else if (x_dnd_last_seen_window != None 17256 else if (x_dnd_last_seen_window != None
17249 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style) 17257 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
17250 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE 17258 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
@@ -17756,7 +17764,9 @@ handle_one_xevent (struct x_display_info *dpyinfo,
17756 17764
17757 x_dnd_waiting_for_finish 17765 x_dnd_waiting_for_finish
17758 = x_dnd_send_drop (x_dnd_finish_frame, 17766 = x_dnd_send_drop (x_dnd_finish_frame,
17759 target, x_dnd_selection_timestamp, 17767 target,
17768 x_dnd_last_seen_toplevel,
17769 x_dnd_selection_timestamp,
17760 x_dnd_send_drop_proto); 17770 x_dnd_send_drop_proto);
17761 } 17771 }
17762 } 17772 }
@@ -19624,7 +19634,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
19624 if (x_dnd_last_seen_window != None 19634 if (x_dnd_last_seen_window != None
19625 && x_dnd_last_protocol_version != -1 19635 && x_dnd_last_protocol_version != -1
19626 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)) 19636 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
19627 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window); 19637 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
19638 x_dnd_last_seen_toplevel);
19628 else if (x_dnd_last_seen_window != None 19639 else if (x_dnd_last_seen_window != None
19629 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 19640 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
19630 && !x_dnd_disable_motif_drag 19641 && !x_dnd_disable_motif_drag
@@ -19664,7 +19675,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
19664 if (x_dnd_last_seen_window != None 19675 if (x_dnd_last_seen_window != None
19665 && x_dnd_last_protocol_version != -1 19676 && x_dnd_last_protocol_version != -1
19666 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)) 19677 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
19667 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window); 19678 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
19679 x_dnd_last_seen_toplevel);
19668 else if (x_dnd_last_seen_window != None 19680 else if (x_dnd_last_seen_window != None
19669 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 19681 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
19670 && x_dnd_disable_motif_drag 19682 && x_dnd_disable_motif_drag
@@ -19714,6 +19726,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
19714 19726
19715 if (target != None && x_dnd_last_protocol_version != -1) 19727 if (target != None && x_dnd_last_protocol_version != -1)
19716 x_dnd_send_enter (x_dnd_frame, target, 19728 x_dnd_send_enter (x_dnd_frame, target,
19729 x_dnd_last_seen_toplevel,
19717 x_dnd_last_protocol_version); 19730 x_dnd_last_protocol_version);
19718 else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 19731 else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
19719 && !x_dnd_disable_motif_drag) 19732 && !x_dnd_disable_motif_drag)
@@ -19741,6 +19754,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
19741 event->xbutton.y_root); 19754 event->xbutton.y_root);
19742 else if (x_dnd_last_protocol_version != -1 && target != None) 19755 else if (x_dnd_last_protocol_version != -1 && target != None)
19743 x_dnd_send_position (x_dnd_frame, target, 19756 x_dnd_send_position (x_dnd_frame, target,
19757 x_dnd_last_seen_toplevel,
19744 x_dnd_last_protocol_version, 19758 x_dnd_last_protocol_version,
19745 event->xmotion.x_root, 19759 event->xmotion.x_root,
19746 event->xmotion.y_root, 19760 event->xmotion.y_root,
@@ -20302,6 +20316,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
20302 else if (x_dnd_last_protocol_version != -1) 20316 else if (x_dnd_last_protocol_version != -1)
20303 x_dnd_send_position (x_dnd_frame, 20317 x_dnd_send_position (x_dnd_frame,
20304 x_dnd_last_seen_window, 20318 x_dnd_last_seen_window,
20319 x_dnd_last_seen_toplevel,
20305 x_dnd_last_protocol_version, 20320 x_dnd_last_protocol_version,
20306 event->xbutton.x_root, 20321 event->xbutton.x_root,
20307 event->xbutton.y_root, 20322 event->xbutton.y_root,
@@ -20354,6 +20369,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
20354 20369
20355 x_dnd_waiting_for_finish 20370 x_dnd_waiting_for_finish
20356 = x_dnd_do_drop (x_dnd_last_seen_window, 20371 = x_dnd_do_drop (x_dnd_last_seen_window,
20372 x_dnd_last_seen_toplevel,
20357 x_dnd_last_protocol_version); 20373 x_dnd_last_protocol_version);
20358 x_dnd_finish_display = dpyinfo->display; 20374 x_dnd_finish_display = dpyinfo->display;
20359 } 20375 }
@@ -21480,7 +21496,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21480 if (x_dnd_last_seen_window != None 21496 if (x_dnd_last_seen_window != None
21481 && x_dnd_last_protocol_version != -1 21497 && x_dnd_last_protocol_version != -1
21482 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)) 21498 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
21483 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window); 21499 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
21500 x_dnd_last_seen_toplevel);
21484 else if (x_dnd_last_seen_window != None 21501 else if (x_dnd_last_seen_window != None
21485 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 21502 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
21486 && !x_dnd_disable_motif_drag 21503 && !x_dnd_disable_motif_drag
@@ -21520,7 +21537,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21520 if (x_dnd_last_seen_window != None 21537 if (x_dnd_last_seen_window != None
21521 && x_dnd_last_protocol_version != -1 21538 && x_dnd_last_protocol_version != -1
21522 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame)) 21539 && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
21523 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window); 21540 x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
21541 x_dnd_last_seen_toplevel);
21524 else if (x_dnd_last_seen_window != None 21542 else if (x_dnd_last_seen_window != None
21525 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 21543 && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
21526 && !x_dnd_disable_motif_drag 21544 && !x_dnd_disable_motif_drag
@@ -21572,6 +21590,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21572 21590
21573 if (target != None && x_dnd_last_protocol_version != -1) 21591 if (target != None && x_dnd_last_protocol_version != -1)
21574 x_dnd_send_enter (x_dnd_frame, target, 21592 x_dnd_send_enter (x_dnd_frame, target,
21593 x_dnd_last_seen_toplevel,
21575 x_dnd_last_protocol_version); 21594 x_dnd_last_protocol_version);
21576 else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style) 21595 else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
21577 && !x_dnd_disable_motif_drag) 21596 && !x_dnd_disable_motif_drag)
@@ -21602,6 +21621,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21602 dnd_state = xi_convert_event_state (xev); 21621 dnd_state = xi_convert_event_state (xev);
21603 21622
21604 x_dnd_send_position (x_dnd_frame, target, 21623 x_dnd_send_position (x_dnd_frame, target,
21624 x_dnd_last_seen_toplevel,
21605 x_dnd_last_protocol_version, 21625 x_dnd_last_protocol_version,
21606 lrint (xev->root_x), 21626 lrint (xev->root_x),
21607 lrint (xev->root_y), 21627 lrint (xev->root_y),
@@ -21820,6 +21840,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21820 else 21840 else
21821 x_dnd_send_position (x_dnd_frame, 21841 x_dnd_send_position (x_dnd_frame,
21822 x_dnd_last_seen_window, 21842 x_dnd_last_seen_window,
21843 x_dnd_last_seen_toplevel,
21823 x_dnd_last_protocol_version, 21844 x_dnd_last_protocol_version,
21824 lrint (xev->root_x), 21845 lrint (xev->root_x),
21825 lrint (xev->root_y), 21846 lrint (xev->root_y),
@@ -21876,6 +21897,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21876 21897
21877 x_dnd_waiting_for_finish 21898 x_dnd_waiting_for_finish
21878 = x_dnd_do_drop (x_dnd_last_seen_window, 21899 = x_dnd_do_drop (x_dnd_last_seen_window,
21900 x_dnd_last_seen_toplevel,
21879 x_dnd_last_protocol_version); 21901 x_dnd_last_protocol_version);
21880 x_dnd_finish_display = dpyinfo->display; 21902 x_dnd_finish_display = dpyinfo->display;
21881 } 21903 }
@@ -24817,7 +24839,8 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror)
24817 if (x_dnd_last_seen_window != None 24839 if (x_dnd_last_seen_window != None
24818 && x_dnd_last_protocol_version != -1) 24840 && x_dnd_last_protocol_version != -1)
24819 x_dnd_send_leave (x_dnd_frame, 24841 x_dnd_send_leave (x_dnd_frame,
24820 x_dnd_last_seen_window); 24842 x_dnd_last_seen_window,
24843 x_dnd_last_seen_toplevel);
24821 else if (x_dnd_last_seen_window != None 24844 else if (x_dnd_last_seen_window != None
24822 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style) 24845 && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
24823 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE 24846 && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE