summaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-04-07 21:16:11 +0800
committerPo Lu <luangruo@yahoo.com>2022-04-07 21:16:11 +0800
commit3b411417086ceb2ce3838160d01c6f250e47bbf3 (patch)
tree7605008be2090be2cc58ba6df8df6c2d22b8184e /src/frame.h
parentc1a6aa0c3eb1029e3f7f5c3b227d7952bee775b8 (diff)
downloademacs-3b411417086ceb2ce3838160d01c6f250e47bbf3.tar.gz
Expose the name of an event's input device to Lisp
This name can be used to identify the device for special treatment, i.e. only interpolating scrolls coming from mice and not touchpads inside pixel-scroll-precision-mode. * doc/lispref/commands.texi (Command Loop Info): Document new variable `last-event-device'. * etc/NEWS: Announce new variable `last-event-device'. * src/frame.h (struct frame): New field `last_mouse_device'. * src/keyboard.c (read_char): Clear last-event-device. (kbd_buffer_get_event): Set last-event-device to the event's recorded device. (init_keyboard): Clear last-event-device. (syms_of_keyboard): New defvar `last-event-device'. * src/termhooks.h (struct input_event): New field `device'. (EVENT_INIT): Set it to the special value `Qt' by default. * src/xterm.c (x_init_master_valuators): Record the device's name. (x_dnd_begin_drag_and_drop): Only preserve last event device if the mouse ended up in the source frame. (x_note_mouse_movement): New argument `source'. (handle_one_xevent): Set input event sources whenever appropriate. (mark_xterm): Mark device names. * src/xterm.h (struct xi_device_t): New field `name'.
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/frame.h b/src/frame.h
index 61df57e966a..4942e640d27 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -102,6 +102,10 @@ struct frame
Lisp_Object parent_frame;
#endif /* HAVE_WINDOW_SYSTEM */
+ /* Last device to move over this frame. Any value that isn't a
+ string means the "Virtual core pointer". */
+ Lisp_Object last_mouse_device;
+
/* The frame which should receive keystrokes that occur in this
frame, or nil if they should go to the frame itself. This is
usually nil, but if the frame is minibufferless, we can use this