-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set _NET_ACTIVE_WINDOW to the current EXWM workspace #111
Conversation
When a non-X window is selected, set _NET_ACTIVE_WINDOW to the current EXWM workspace (i.e., the Emacs frame containing the selected window). This behavior can be tested with, e.g., `xdotool getactivewindow'. * exwm-input.el (exwm-input--set-active-window): The window ID is now mandatory. (exwm--input-update-focus): When focusing on a workspace, set the active window to the workspace's window ID. (#77)
(x-focus-frame frame) | ||
(exwm-input--set-active-window | ||
(or (frame-parameter exwm-workspace--current 'exwm-outer-id) | ||
xcb:Window:None))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never hit this case but I'm not 100% sure there isn't a race somewhere (e.g., when creating new workspaces).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use exwm-workspace--current here instead of frame, since we called x-focus-frame on frame? Should be the same, right? Instead of the or with xcb:Window:None you could also preserve the old exwm-input--set-active-window calling convention which allows a nil argument, such that the change is overall more minimal.
@@ -373,23 +373,25 @@ attempt later." | |||
window) | |||
(exwm--defer 0 #'exwm-workspace-switch (selected-frame))) | |||
;; The focus is still on the current workspace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is only supposed to cover switching focus within a workspace, not between workspaces. However, from my testing, we hit this case when switching workspaces anyways so there's no need to update _NET_ACTIVE_WINDOW
from the other case.
I've tested this with multiple workspaces, multiple monitors, floating windows, etc. so I think I've covered most cases. Posframe windows that take focus (e.g., vertico-posframe) treat the current workspace as focused but, IMO, that's fine. |
There are two other places in exwm.el and exwm-workspace.el where |
|
(merging because I haven't run into any bugs so far) |
When a non-X window is selected, set _NET_ACTIVE_WINDOW to the current EXWM workspace (i.e., the Emacs frame containing the selected window). This behavior can be tested with, e.g., `xdotool getactivewindow'.
(exwm--input-update-focus): When focusing on a workspace, set the active window to the workspace's window ID. (Setting _NET_ACTIVE_WINDOW to emacs when non-EXWM buffer in focus #77)