aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-05 09:39:57 +0800
committerPo Lu2022-01-05 09:39:57 +0800
commit6719a3ccabec33e010aa4a42be2ee07e4e219b3c (patch)
tree8439c70b986e1b76a6bbe6effe2a318eddf02820 /src
parent30d4cfc0806ee1de5a8e5091f0cc5bce22830460 (diff)
downloademacs-6719a3ccabec33e010aa4a42be2ee07e4e219b3c.tar.gz
emacs-6719a3ccabec33e010aa4a42be2ee07e4e219b3c.zip
Correctly set up XI key input mask on X Toolkit builds
* src/xfns.c (setup_xi_event_mask): Also set the key event mask on the outer window, which might also have the input focus. (x_window) [USE_X_TOOLKIT]: Set up XI event mask a bit later.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/xfns.c b/src/xfns.c
index d1b0b72b7f0..b94fe179224 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2934,15 +2934,11 @@ setup_xi_event_mask (struct frame *f)
2934 2934
2935 XISetMask (m, XI_ButtonPress); 2935 XISetMask (m, XI_ButtonPress);
2936 XISetMask (m, XI_ButtonRelease); 2936 XISetMask (m, XI_ButtonRelease);
2937 XISetMask (m, XI_KeyPress);
2938 XISetMask (m, XI_KeyRelease);
2939 XISetMask (m, XI_Motion); 2937 XISetMask (m, XI_Motion);
2940 XISetMask (m, XI_Enter); 2938 XISetMask (m, XI_Enter);
2941 XISetMask (m, XI_Leave); 2939 XISetMask (m, XI_Leave);
2942#if 0 2940 XISetMask (m, XI_KeyPress);
2943 XISetMask (m, XI_FocusIn); 2941 XISetMask (m, XI_KeyRelease);
2944 XISetMask (m, XI_FocusOut);
2945#endif
2946 XISelectEvents (FRAME_X_DISPLAY (f), 2942 XISelectEvents (FRAME_X_DISPLAY (f),
2947 FRAME_X_WINDOW (f), 2943 FRAME_X_WINDOW (f),
2948 &mask, 1); 2944 &mask, 1);
@@ -2950,6 +2946,16 @@ setup_xi_event_mask (struct frame *f)
2950 memset (m, 0, l); 2946 memset (m, 0, l);
2951#endif /* !USE_GTK */ 2947#endif /* !USE_GTK */
2952 2948
2949#ifdef USE_X_TOOLKIT
2950 XISetMask (m, XI_KeyPress);
2951 XISetMask (m, XI_KeyRelease);
2952
2953 XISelectEvents (FRAME_X_DISPLAY (f),
2954 FRAME_OUTER_WINDOW (f),
2955 &mask, 1);
2956 memset (m, 0, l);
2957#endif
2958
2953 mask.deviceid = XIAllDevices; 2959 mask.deviceid = XIAllDevices;
2954 2960
2955 XISetMask (m, XI_PropertyEvent); 2961 XISetMask (m, XI_PropertyEvent);
@@ -3140,11 +3146,6 @@ x_window (struct frame *f, long window_prompting)
3140 class_hints.res_class = SSDATA (Vx_resource_class); 3146 class_hints.res_class = SSDATA (Vx_resource_class);
3141 XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints); 3147 XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
3142 3148
3143#ifdef HAVE_XINPUT2
3144 if (FRAME_DISPLAY_INFO (f)->supports_xi2)
3145 setup_xi_event_mask (f);
3146#endif
3147
3148#ifdef HAVE_X_I18N 3149#ifdef HAVE_X_I18N
3149 FRAME_XIC (f) = NULL; 3150 FRAME_XIC (f) = NULL;
3150 if (use_xim) 3151 if (use_xim)
@@ -3232,6 +3233,11 @@ x_window (struct frame *f, long window_prompting)
3232 /* This is a no-op, except under Motif. Make sure main areas are 3233 /* This is a no-op, except under Motif. Make sure main areas are
3233 set to something reasonable, in case we get an error later. */ 3234 set to something reasonable, in case we get an error later. */
3234 lw_set_main_areas (pane_widget, 0, frame_widget); 3235 lw_set_main_areas (pane_widget, 0, frame_widget);
3236
3237#ifdef HAVE_XINPUT2
3238 if (FRAME_DISPLAY_INFO (f)->supports_xi2)
3239 setup_xi_event_mask (f);
3240#endif
3235} 3241}
3236 3242
3237#else /* not USE_X_TOOLKIT */ 3243#else /* not USE_X_TOOLKIT */