diff options
| author | Po Lu | 2022-10-02 08:28:56 +0800 |
|---|---|---|
| committer | Po Lu | 2022-10-02 08:28:56 +0800 |
| commit | 3924fbd0257a53e10502d6cdee32616fbe26f0c2 (patch) | |
| tree | 799de0237f88360d506635985db0403412c6217b /src | |
| parent | 8a2bc8603996db24f206fc0c933536c7695a537a (diff) | |
| download | emacs-3924fbd0257a53e10502d6cdee32616fbe26f0c2.tar.gz emacs-3924fbd0257a53e10502d6cdee32616fbe26f0c2.zip | |
Only rely on EWMH window activation if possible
* xterm.c (x_ewmh_activate_frame): Remove unnecessary
x_wm_supports check.
(x_focus_frame): When the window manager supports
_NET_ACTIVE_WINDOW, just use it; anything else may confuse the
window manager.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index 947cf7edb54..d83b03d1ca6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -26842,8 +26842,7 @@ x_ewmh_activate_frame (struct frame *f) | |||
| 26842 | 26842 | ||
| 26843 | dpyinfo = FRAME_DISPLAY_INFO (f); | 26843 | dpyinfo = FRAME_DISPLAY_INFO (f); |
| 26844 | 26844 | ||
| 26845 | if (FRAME_VISIBLE_P (f) | 26845 | if (FRAME_VISIBLE_P (f)) |
| 26846 | && x_wm_supports (f, dpyinfo->Xatom_net_active_window)) | ||
| 26847 | { | 26846 | { |
| 26848 | /* See the documentation at | 26847 | /* See the documentation at |
| 26849 | https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html | 26848 | https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html |
| @@ -26903,14 +26902,23 @@ x_focus_frame (struct frame *f, bool noactivate) | |||
| 26903 | xembed_request_focus (f); | 26902 | xembed_request_focus (f); |
| 26904 | else | 26903 | else |
| 26905 | { | 26904 | { |
| 26905 | if (!noactivate | ||
| 26906 | && x_wm_supports (f, dpyinfo->Xatom_net_active_window)) | ||
| 26907 | { | ||
| 26908 | /* When window manager activation is possible, use it | ||
| 26909 | instead. The window manager is expected to perform any | ||
| 26910 | necessary actions such as raising the frame, moving it to | ||
| 26911 | the current workspace, and mapping it, etc, before moving | ||
| 26912 | input focus to the frame. */ | ||
| 26913 | x_ewmh_activate_frame (f); | ||
| 26914 | return; | ||
| 26915 | } | ||
| 26916 | |||
| 26906 | /* Ignore any BadMatch error this request might result in. */ | 26917 | /* Ignore any BadMatch error this request might result in. */ |
| 26907 | x_ignore_errors_for_next_request (dpyinfo); | 26918 | x_ignore_errors_for_next_request (dpyinfo); |
| 26908 | XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), | 26919 | XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), |
| 26909 | RevertToParent, CurrentTime); | 26920 | RevertToParent, CurrentTime); |
| 26910 | x_stop_ignoring_errors (dpyinfo); | 26921 | x_stop_ignoring_errors (dpyinfo); |
| 26911 | |||
| 26912 | if (!noactivate) | ||
| 26913 | x_ewmh_activate_frame (f); | ||
| 26914 | } | 26922 | } |
| 26915 | } | 26923 | } |
| 26916 | 26924 | ||