From: Po Lu Date: Sat, 9 Apr 2022 03:37:56 +0000 (+0800) Subject: Use right frame when computing mouse movement device X-Git-Tag: emacs-29.0.90~1931^2~689 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=72782ca182993dac6bd805bb3b54b21b7e7efa7d;p=emacs.git Use right frame when computing mouse movement device * src/keyboard.c (kbd_buffer_get_event): Use the frame on which the mouse actually moved to compute the last mouse device. --- diff --git a/src/keyboard.c b/src/keyboard.c index 642ae7d7e0a..98eebaf7f53 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4275,12 +4275,13 @@ kbd_buffer_get_event (KBOARD **kbp, /* Try generating a mouse motion event. */ else if (some_mouse_moved ()) { - struct frame *f = some_mouse_moved (); + struct frame *f, *movement_frame = some_mouse_moved (); Lisp_Object bar_window; enum scroll_bar_part part; Lisp_Object x, y; Time t; + f = movement_frame; *kbp = current_kboard; /* Note that this uses F to determine which terminal to look at. If there is no valid info, it does not store anything @@ -4317,8 +4318,8 @@ kbd_buffer_get_event (KBOARD **kbp, obj = make_lispy_movement (f, bar_window, part, x, y, t); if (!NILP (obj)) - Vlast_event_device = (f && STRINGP (f->last_mouse_device) - ? f->last_mouse_device + Vlast_event_device = (STRINGP (movement_frame->last_mouse_device) + ? movement_frame->last_mouse_device : virtual_core_pointer_name); } else