emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cb45fff0cb: Minor cleanups in X Windows drag-and-drop code


From: Po Lu
Subject: master cb45fff0cb: Minor cleanups in X Windows drag-and-drop code
Date: Fri, 8 Apr 2022 23:36:04 -0400 (EDT)

branch: master
commit cb45fff0cb01d7a2e428676e0406bcc7ebc1e63a
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Minor cleanups in X Windows drag-and-drop code
    
    * 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 |  2 +-
 src/xterm.c    | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/keyboard.c b/src/keyboard.c
index 588ee75ee0..642ae7d7e0 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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);
     }
diff --git a/src/xterm.c b/src/xterm.c
index 329376cab2..d94a3cf91a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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 ();
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]