diff options
| author | Po Lu | 2022-09-04 21:03:31 +0800 |
|---|---|---|
| committer | Po Lu | 2022-09-04 21:04:19 +0800 |
| commit | 55ff36485f42777a4eaecd187cd25da5a7c153cd (patch) | |
| tree | ed7905b4a5683c896e40dcef356a37a0cfc367c8 | |
| parent | f1635c8efb30cd42b83e31aa29be58aeb2965a9a (diff) | |
| download | emacs-55ff36485f42777a4eaecd187cd25da5a7c153cd.tar.gz emacs-55ff36485f42777a4eaecd187cd25da5a7c153cd.zip | |
Fix earlier change to xterm.c
* src/xterm.c (x_detect_focus_change): Finally figure out what
the call to x_new_focus_frame does with the core focus, and do
the equivalent with the XInput 2 focus.
| -rw-r--r-- | src/xterm.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index accd1b90fb8..c58f2d15da2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -13174,7 +13174,12 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame, | |||
| 13174 | void | 13174 | void |
| 13175 | x_mouse_leave (struct x_display_info *dpyinfo) | 13175 | x_mouse_leave (struct x_display_info *dpyinfo) |
| 13176 | { | 13176 | { |
| 13177 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; | 13177 | #if defined HAVE_XINPUT2 && !defined USE_X_TOOLKIT |
| 13178 | struct xi_device_t *device; | ||
| 13179 | #endif | ||
| 13180 | Mouse_HLInfo *hlinfo; | ||
| 13181 | |||
| 13182 | hlinfo = &dpyinfo->mouse_highlight; | ||
| 13178 | 13183 | ||
| 13179 | if (hlinfo->mouse_face_mouse_frame) | 13184 | if (hlinfo->mouse_face_mouse_frame) |
| 13180 | { | 13185 | { |
| @@ -13182,13 +13187,30 @@ x_mouse_leave (struct x_display_info *dpyinfo) | |||
| 13182 | hlinfo->mouse_face_mouse_frame = NULL; | 13187 | hlinfo->mouse_face_mouse_frame = NULL; |
| 13183 | } | 13188 | } |
| 13184 | 13189 | ||
| 13185 | #ifdef HAVE_XINPUT2 | 13190 | #if defined HAVE_XINPUT2 && !defined USE_X_TOOLKIT |
| 13186 | if (!dpyinfo->supports_xi2) | 13191 | if (!dpyinfo->supports_xi2) |
| 13187 | /* I don't understand what the call below is supposed to do. But | 13192 | /* The call below is supposed to reset the implicit focus and |
| 13188 | reading dpyinfo->x_focus_event_frame is invalid on input | 13193 | revert the focus back to the last explicitly focused frame. It |
| 13189 | extension builds, so disable it there. */ | 13194 | doesn't work on input extension builds because focus tracking |
| 13195 | does not set x_focus_event_frame, and proceeds on a per-device | ||
| 13196 | basis. On such builds, clear the implicit focus of the client | ||
| 13197 | pointer instead. */ | ||
| 13190 | #endif | 13198 | #endif |
| 13191 | x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); | 13199 | x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); |
| 13200 | #if defined HAVE_XINPUT2 && !defined USE_X_TOOLKIT | ||
| 13201 | else | ||
| 13202 | { | ||
| 13203 | if (dpyinfo->client_pointer_device == -1) | ||
| 13204 | /* If there's no client pointer device, then no implicit focus | ||
| 13205 | is currently set. */ | ||
| 13206 | return; | ||
| 13207 | |||
| 13208 | device = xi_device_from_id (dpyinfo, dpyinfo->client_pointer_device); | ||
| 13209 | |||
| 13210 | if (device) | ||
| 13211 | device->focus_implicit_frame = NULL; | ||
| 13212 | } | ||
| 13213 | #endif | ||
| 13192 | } | 13214 | } |
| 13193 | #endif | 13215 | #endif |
| 13194 | 13216 | ||