]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor cleanups in X Windows drag-and-drop code
authorPo Lu <luangruo@yahoo.com>
Sat, 9 Apr 2022 03:35:08 +0000 (11:35 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 9 Apr 2022 03:35:08 +0000 (11:35 +0800)
* src/keyboard.c (kbd_buffer_get_event): Don't dereference f if
nil when generating mouse motion event.
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_send_scroll_bar_event):
Use NoEventMask instead of 0.

src/keyboard.c
src/xterm.c

index 588ee75ee006a9920bf97e514288ec5329c934da..642ae7d7e0ad95672cd051d7c0a5745ebf93ecb8 100644 (file)
@@ -4317,7 +4317,7 @@ kbd_buffer_get_event (KBOARD **kbp,
        obj = make_lispy_movement (f, bar_window, part, x, y, t);
 
       if (!NILP (obj))
-       Vlast_event_device = (STRINGP (f->last_mouse_device)
+       Vlast_event_device = (f && STRINGP (f->last_mouse_device)
                              ? f->last_mouse_device
                              : virtual_core_pointer_name);
     }
index 329376cab2c42960313b66a963d60342fa2bfaf5..d94a3cf91a9a2d8510af40e1835c48e2dff045af 100644 (file)
@@ -3331,7 +3331,7 @@ x_dnd_send_enter (struct frame *f, Window target, int supported)
                     x_dnd_n_targets);
 
   x_catch_errors (dpyinfo->display);
-  XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg);
+  XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
   x_uncatch_errors ();
 }
 
@@ -3390,7 +3390,7 @@ x_dnd_send_position (struct frame *f, Window target, int supported,
     msg.xclient.data.l[4] = action;
 
   x_catch_errors (dpyinfo->display);
-  XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg);
+  XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
   x_uncatch_errors ();
 }
 
@@ -3414,7 +3414,7 @@ x_dnd_send_leave (struct frame *f, Window target)
   msg.xclient.data.l[4] = 0;
 
   x_catch_errors (dpyinfo->display);
-  XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg);
+  XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
   x_uncatch_errors ();
 }
 
@@ -3504,7 +3504,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
     msg.xclient.data.l[2] = timestamp;
 
   x_catch_errors (dpyinfo->display);
-  XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg);
+  XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
   x_uncatch_errors ();
   return true;
 }
@@ -10735,7 +10735,8 @@ x_send_scroll_bar_event (Lisp_Object window, enum scroll_bar_part part,
   /* Setting the event mask to zero means that the message will
      be sent to the client that created the window, and if that
      window no longer exists, no event will be sent.  */
-  XSendEvent (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), False, 0, &event);
+  XSendEvent (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), False,
+             NoEventMask, &event);
   unblock_input ();
 }