aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-04-09 11:35:08 +0800
committerPo Lu2022-04-09 11:35:08 +0800
commitcb45fff0cb01d7a2e428676e0406bcc7ebc1e63a (patch)
treeb6528b8ead6e052759ce4fc412d92e4dd54485e0 /src
parentf1bf1a069853315c0fa116ef4716ba38c9a67417 (diff)
downloademacs-cb45fff0cb01d7a2e428676e0406bcc7ebc1e63a.tar.gz
emacs-cb45fff0cb01d7a2e428676e0406bcc7ebc1e63a.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c2
-rw-r--r--src/xterm.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 588ee75ee00..642ae7d7e0a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4317,7 +4317,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4317 obj = make_lispy_movement (f, bar_window, part, x, y, t); 4317 obj = make_lispy_movement (f, bar_window, part, x, y, t);
4318 4318
4319 if (!NILP (obj)) 4319 if (!NILP (obj))
4320 Vlast_event_device = (STRINGP (f->last_mouse_device) 4320 Vlast_event_device = (f && STRINGP (f->last_mouse_device)
4321 ? f->last_mouse_device 4321 ? f->last_mouse_device
4322 : virtual_core_pointer_name); 4322 : virtual_core_pointer_name);
4323 } 4323 }
diff --git a/src/xterm.c b/src/xterm.c
index 329376cab2c..d94a3cf91a9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3331,7 +3331,7 @@ x_dnd_send_enter (struct frame *f, Window target, int supported)
3331 x_dnd_n_targets); 3331 x_dnd_n_targets);
3332 3332
3333 x_catch_errors (dpyinfo->display); 3333 x_catch_errors (dpyinfo->display);
3334 XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg); 3334 XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
3335 x_uncatch_errors (); 3335 x_uncatch_errors ();
3336} 3336}
3337 3337
@@ -3390,7 +3390,7 @@ x_dnd_send_position (struct frame *f, Window target, int supported,
3390 msg.xclient.data.l[4] = action; 3390 msg.xclient.data.l[4] = action;
3391 3391
3392 x_catch_errors (dpyinfo->display); 3392 x_catch_errors (dpyinfo->display);
3393 XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg); 3393 XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
3394 x_uncatch_errors (); 3394 x_uncatch_errors ();
3395} 3395}
3396 3396
@@ -3414,7 +3414,7 @@ x_dnd_send_leave (struct frame *f, Window target)
3414 msg.xclient.data.l[4] = 0; 3414 msg.xclient.data.l[4] = 0;
3415 3415
3416 x_catch_errors (dpyinfo->display); 3416 x_catch_errors (dpyinfo->display);
3417 XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg); 3417 XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
3418 x_uncatch_errors (); 3418 x_uncatch_errors ();
3419} 3419}
3420 3420
@@ -3504,7 +3504,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
3504 msg.xclient.data.l[2] = timestamp; 3504 msg.xclient.data.l[2] = timestamp;
3505 3505
3506 x_catch_errors (dpyinfo->display); 3506 x_catch_errors (dpyinfo->display);
3507 XSendEvent (FRAME_X_DISPLAY (f), target, False, 0, &msg); 3507 XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
3508 x_uncatch_errors (); 3508 x_uncatch_errors ();
3509 return true; 3509 return true;
3510} 3510}
@@ -10735,7 +10735,8 @@ x_send_scroll_bar_event (Lisp_Object window, enum scroll_bar_part part,
10735 /* Setting the event mask to zero means that the message will 10735 /* Setting the event mask to zero means that the message will
10736 be sent to the client that created the window, and if that 10736 be sent to the client that created the window, and if that
10737 window no longer exists, no event will be sent. */ 10737 window no longer exists, no event will be sent. */
10738 XSendEvent (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), False, 0, &event); 10738 XSendEvent (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), False,
10739 NoEventMask, &event);
10739 unblock_input (); 10740 unblock_input ();
10740} 10741}
10741 10742