diff options
| author | Po Lu | 2022-07-18 09:20:05 +0800 |
|---|---|---|
| committer | Po Lu | 2022-07-18 09:20:05 +0800 |
| commit | 356618ca6a649979256552de8f2fa2a5ab6a0161 (patch) | |
| tree | a0ee5919fb213747dbf6c0f4c691758bfbec715d /src | |
| parent | 15df17964df385dbec2119d52fef8e5b368ee99d (diff) | |
| download | emacs-356618ca6a649979256552de8f2fa2a5ab6a0161.tar.gz emacs-356618ca6a649979256552de8f2fa2a5ab6a0161.zip | |
Handle virtual modifiers in the DND scrolling code
* lisp/x-dnd.el (x-dnd-modifier-mask): Handle virtual modifiers.
* src/xfns.c (Fx_get_modifier_masks): New function.
(syms_of_xfns): Define new subr.
* src/xterm.c (x_get_keyboard_modifiers): New function.
* src/xterm.h: Update prototypes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 19 | ||||
| -rw-r--r-- | src/xterm.c | 21 | ||||
| -rw-r--r-- | src/xterm.h | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c index 1a65698f490..44208ffd515 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -9426,6 +9426,24 @@ present and mapped to the usual X keysyms. */) | |||
| 9426 | #endif | 9426 | #endif |
| 9427 | } | 9427 | } |
| 9428 | 9428 | ||
| 9429 | DEFUN ("x-get-modifier-masks", Fx_get_modifier_masks, Sx_get_modifier_masks, | ||
| 9430 | 0, 1, 0, | ||
| 9431 | doc: /* Return the X modifier masks corresponding to keyboard modifiers. | ||
| 9432 | The optional second argument TERMINAL specifies which display to fetch | ||
| 9433 | modifier masks from. TERMINAL should be a terminal object, a frame or | ||
| 9434 | a display name (a string). If TERMINAL is omitted or nil, that stands | ||
| 9435 | for the selected frame's display. | ||
| 9436 | |||
| 9437 | Return a list of (HYPER SUPER ALT SHIFT-LOCK META), each element being | ||
| 9438 | a number describing the modifier mask for the corresponding Emacs | ||
| 9439 | modifier. */) | ||
| 9440 | (Lisp_Object terminal) | ||
| 9441 | { | ||
| 9442 | struct x_display_info *dpyinfo; | ||
| 9443 | |||
| 9444 | dpyinfo = check_x_display_info (terminal); | ||
| 9445 | return x_get_keyboard_modifiers (dpyinfo); | ||
| 9446 | } | ||
| 9429 | 9447 | ||
| 9430 | 9448 | ||
| 9431 | /*********************************************************************** | 9449 | /*********************************************************************** |
| @@ -10090,6 +10108,7 @@ eliminated in future versions of Emacs. */); | |||
| 10090 | defsubr (&Sx_begin_drag); | 10108 | defsubr (&Sx_begin_drag); |
| 10091 | defsubr (&Sx_display_set_last_user_time); | 10109 | defsubr (&Sx_display_set_last_user_time); |
| 10092 | defsubr (&Sx_translate_coordinates); | 10110 | defsubr (&Sx_translate_coordinates); |
| 10111 | defsubr (&Sx_get_modifier_masks); | ||
| 10093 | 10112 | ||
| 10094 | tip_timer = Qnil; | 10113 | tip_timer = Qnil; |
| 10095 | staticpro (&tip_timer); | 10114 | staticpro (&tip_timer); |
diff --git a/src/xterm.c b/src/xterm.c index bd142cf9f74..53c640ca6c2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -28187,6 +28187,27 @@ x_preserve_selections (struct x_display_info *dpyinfo, Lisp_Object lost, | |||
| 28187 | } | 28187 | } |
| 28188 | } | 28188 | } |
| 28189 | 28189 | ||
| 28190 | /* Return a list of the keyboard modifier masks in DPYINFO. | ||
| 28191 | |||
| 28192 | Value is a list of (HYPER SUPER ALT SHIFT-LOCK META), each element | ||
| 28193 | being the appropriate modifier mask. */ | ||
| 28194 | |||
| 28195 | Lisp_Object | ||
| 28196 | x_get_keyboard_modifiers (struct x_display_info *dpyinfo) | ||
| 28197 | { | ||
| 28198 | /* This sometimes happens when the function is called during display | ||
| 28199 | initialization, which can happen while obtaining vendor specific | ||
| 28200 | keysyms. */ | ||
| 28201 | if (!dpyinfo->xkb_desc && !dpyinfo->modmap) | ||
| 28202 | x_find_modifier_meanings (dpyinfo); | ||
| 28203 | |||
| 28204 | return list5 (make_uint (dpyinfo->hyper_mod_mask), | ||
| 28205 | make_uint (dpyinfo->super_mod_mask), | ||
| 28206 | make_uint (dpyinfo->alt_mod_mask), | ||
| 28207 | make_uint (dpyinfo->shift_lock_mask), | ||
| 28208 | make_uint (dpyinfo->meta_mod_mask)); | ||
| 28209 | } | ||
| 28210 | |||
| 28190 | void | 28211 | void |
| 28191 | syms_of_xterm (void) | 28212 | syms_of_xterm (void) |
| 28192 | { | 28213 | { |
diff --git a/src/xterm.h b/src/xterm.h index 6afd08eab2b..b9e7b094e31 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -1645,6 +1645,7 @@ extern bool x_defined_color (struct frame *, const char *, Emacs_Color *, | |||
| 1645 | bool, bool); | 1645 | bool, bool); |
| 1646 | extern void x_preserve_selections (struct x_display_info *, Lisp_Object, | 1646 | extern void x_preserve_selections (struct x_display_info *, Lisp_Object, |
| 1647 | Lisp_Object); | 1647 | Lisp_Object); |
| 1648 | extern Lisp_Object x_get_keyboard_modifiers (struct x_display_info *); | ||
| 1648 | #ifdef HAVE_X_I18N | 1649 | #ifdef HAVE_X_I18N |
| 1649 | extern void free_frame_xic (struct frame *); | 1650 | extern void free_frame_xic (struct frame *); |
| 1650 | # if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT | 1651 | # if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT |