]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix error when calling DND movement tracking function
authorPo Lu <luangruo@yahoo.com>
Thu, 7 Apr 2022 06:32:10 +0000 (14:32 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 7 Apr 2022 06:32:10 +0000 (14:32 +0800)
* src/xterm.c (x_dnd_begin_drag_and_drop): Verify
x_dnd_movement_x and x_dnd_movement_y are wholenums before
caling posn-at-x-y.

src/xterm.c

index f5770ad7e7c7e99a2a87e9de244efc3e516d8c85..57a64cb5d12b6c2f59b016eea70eb74920a4c9e0 100644 (file)
@@ -9540,7 +9540,12 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
          x_dnd_movement_frame = NULL;
 
          if (!NILP (Vx_dnd_movement_function)
-             && !FRAME_TOOLTIP_P (XFRAME (frame_object)))
+             && !FRAME_TOOLTIP_P (XFRAME (frame_object))
+             && x_dnd_movement_x >= 0
+             && x_dnd_movement_y >= 0
+             && x_dnd_frame
+             && (XFRAME (frame_object) != x_dnd_frame
+                 || x_dnd_allow_current_frame))
            {
              x_dnd_old_window_attrs = root_window_attrs;
              x_dnd_unwind_flag = true;