diff options
author | Po Lu <luangruo@yahoo.com> | 2022-04-08 13:37:16 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-04-08 13:37:16 +0800 |
commit | ac2708bf6f83dfb965694381c4e9d0c71f61bd0c (patch) | |
tree | 93c26be2946195cd3380eef81401d33a440a27e8 /lisp/term | |
parent | e9849939549010529e180ffb2509922f1bcc4843 (diff) | |
download | emacs-ac2708bf6f83dfb965694381c4e9d0c71f61bd0c.tar.gz emacs-ac2708bf6f83dfb965694381c4e9d0c71f61bd0c.tar.bz2 emacs-ac2708bf6f83dfb965694381c4e9d0c71f61bd0c.zip |
Implement support for reporting device names on PGTK
* lisp/frame.el (device-class): Add new function.
* lisp/term/pgtk-win.el (pgtk-device-class): New function.
* src/pgtkterm.c (pgtk_device_added_or_removal_cb)
(pgtk_seat_added_cb, pgtk_seat_removed_cb)
(pgtk_enumerate_devices)
(pgtk_free_devices, pgtk_regenerate_devices)
(pgtk_get_device_for_event): New functions.
(mark_pgtkterm): Mark device data.
(pgtk_delete_terminal): Delete device data.
(pgtk_handle_event, key_press_event, note_mouse_movement)
(construct_mouse_click, button_event, scroll_event)
(drag_data_received): Set device correctly.
(pgtk_term_init): Initialize device data and seat tracking.
(pgtk_delete_display): Delete device data.
* src/pgtkterm.h (struct pgtk_device_t): New struct.
(struct pgtk_display_info): New field `devices'. Delete lots of
unused macros and reformat comments.
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/pgtk-win.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/term/pgtk-win.el b/lisp/term/pgtk-win.el index a9d6db2d45b..5317f6ba01a 100644 --- a/lisp/term/pgtk-win.el +++ b/lisp/term/pgtk-win.el @@ -367,6 +367,27 @@ This uses `icon-map-list' to map icon file names to stock icon names." (t (popup-menu (mouse-menu-bar-map) last-nonmenu-event)))) +(defun pgtk-device-class (name) + "Return the device class of NAME. +Users should not call this function; see `device-class' instead." + (cond + ((string-match-p "XTEST" name) 'test) + ((string= "Virtual core pointer" name) 'core-pointer) + ((string= "Virtual core keyboard" name) 'core-keyboard) + (t (let ((number (ignore-errors + (string-to-number name)))) + (when number + (cl-case number + (0 'mouse) + (1 'pen) + (2 'eraser) + (3 'puck) + (4 'keyboard) + (5 'touchscreen) + (6 'touchpad) + (7 'trackpoint) + (8 'pad))))))) + (defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips) (provide 'pgtk-win) |