diff options
| author | Po Lu | 2022-09-03 19:55:31 +0800 |
|---|---|---|
| committer | Po Lu | 2022-09-03 19:57:12 +0800 |
| commit | 91ba20fff159cc88c87e09f5a8256d6412c98990 (patch) | |
| tree | 671f0c4cd350f4f24f65b0e3f26fbb921e33c0e4 /src | |
| parent | dcfe3314cd78e95d992fe00f757ce906d49586cd (diff) | |
| download | emacs-91ba20fff159cc88c87e09f5a8256d6412c98990.tar.gz emacs-91ba20fff159cc88c87e09f5a8256d6412c98990.zip | |
Work around potential X server bug
* src/xterm.c (handle_one_xevent): Ignore core crossing events
on input extension builds. The X server is not actually
supposed to deliver them to us, and it messes up MPX focus
tracking. (bug#57468)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 138fa7ea6c8..19d2198cdf6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -19276,6 +19276,18 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19276 | x_display_set_last_user_time (dpyinfo, event->xcrossing.time, | 19276 | x_display_set_last_user_time (dpyinfo, event->xcrossing.time, |
| 19277 | event->xcrossing.send_event); | 19277 | event->xcrossing.send_event); |
| 19278 | 19278 | ||
| 19279 | #ifdef HAVE_XINPUT2 | ||
| 19280 | /* For whatever reason, the X server continues to deliver | ||
| 19281 | EnterNotify and LeaveNotify events despite us selecting for | ||
| 19282 | related XI_Enter and XI_Leave events. It's not just our | ||
| 19283 | problem, since windows created by "xinput test-xi2" suffer | ||
| 19284 | from the same defect. Simply ignore all such events while | ||
| 19285 | the input extension is enabled. (bug#57468) */ | ||
| 19286 | |||
| 19287 | if (dpyinfo->supports_xi2) | ||
| 19288 | goto OTHER; | ||
| 19289 | #endif | ||
| 19290 | |||
| 19279 | if (x_top_window_to_frame (dpyinfo, event->xcrossing.window)) | 19291 | if (x_top_window_to_frame (dpyinfo, event->xcrossing.window)) |
| 19280 | x_detect_focus_change (dpyinfo, any, event, &inev.ie); | 19292 | x_detect_focus_change (dpyinfo, any, event, &inev.ie); |
| 19281 | 19293 | ||
| @@ -19377,6 +19389,18 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19377 | x_display_set_last_user_time (dpyinfo, event->xcrossing.time, | 19389 | x_display_set_last_user_time (dpyinfo, event->xcrossing.time, |
| 19378 | event->xcrossing.send_event); | 19390 | event->xcrossing.send_event); |
| 19379 | 19391 | ||
| 19392 | #ifdef HAVE_XINPUT2 | ||
| 19393 | /* For whatever reason, the X server continues to deliver | ||
| 19394 | EnterNotify and LeaveNotify events despite us selecting for | ||
| 19395 | related XI_Enter and XI_Leave events. It's not just our | ||
| 19396 | problem, since windows created by "xinput test-xi2" suffer | ||
| 19397 | from the same defect. Simply ignore all such events while | ||
| 19398 | the input extension is enabled. (bug#57468) */ | ||
| 19399 | |||
| 19400 | if (dpyinfo->supports_xi2) | ||
| 19401 | goto OTHER; | ||
| 19402 | #endif | ||
| 19403 | |||
| 19380 | #ifdef HAVE_XWIDGETS | 19404 | #ifdef HAVE_XWIDGETS |
| 19381 | { | 19405 | { |
| 19382 | struct xwidget_view *xvw = xwidget_view_from_window (event->xcrossing.window); | 19406 | struct xwidget_view *xvw = xwidget_view_from_window (event->xcrossing.window); |
| @@ -19402,14 +19426,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 19402 | #else | 19426 | #else |
| 19403 | f = x_top_window_to_frame (dpyinfo, event->xcrossing.window); | 19427 | f = x_top_window_to_frame (dpyinfo, event->xcrossing.window); |
| 19404 | #endif | 19428 | #endif |
| 19405 | #if defined USE_X_TOOLKIT && defined HAVE_XINPUT2 && !defined USE_MOTIF | 19429 | |
| 19406 | /* The XI2 event mask is set on the frame widget, so this event | ||
| 19407 | likely originates from the shell widget, which we aren't | ||
| 19408 | interested in. (But don't ignore this on Motif, since we | ||
| 19409 | want to clear the mouse face when a popup is active.) */ | ||
| 19410 | if (dpyinfo->supports_xi2) | ||
| 19411 | f = NULL; | ||
| 19412 | #endif | ||
| 19413 | if (f) | 19430 | if (f) |
| 19414 | { | 19431 | { |
| 19415 | /* Now clear dpyinfo->last_mouse_motion_frame, or | 19432 | /* Now clear dpyinfo->last_mouse_motion_frame, or |