desktop: add commentary clarifying focus rules

This commit is contained in:
John Lindgren 2023-10-02 22:37:12 -04:00
parent 9be6bd8b1d
commit b7bd5a52e4
3 changed files with 30 additions and 1 deletions

View file

@ -73,6 +73,13 @@ desktop_focus_view(struct view *view, bool raise)
workspaces_switch_to(view->workspace, /*update_focus*/ false);
}
/*
* Give input focus, even if the view claims not to want it (see
* view->impl->wants_focus). This is a workaround for so-called
* "globally active" X11 views (MATLAB known to be one such)
* that expect to be able to control focus themselves, but can't
* under labwc since it's disallowed at the wlroots level.
*/
struct seat *seat = &server->seat;
if (view->surface != seat->seat->keyboard_state.focused_surface) {
seat_focus_surface(seat, view->surface);

View file

@ -49,7 +49,8 @@ xwayland_view_wants_focus(struct view *view)
* Clients that use XSetInputFocus() to explicitly set the input
* focus should set the WM_TAKE_FOCUS atom in WM_PROTOCOLS.
* Currently, labwc does not support this method of taking focus
* and thus makes no use of WM_TAKE_FOCUS.
* and thus ignores WM_TAKE_FOCUS. These views can still be
* focused by explicit user action (e.g. clicking in them).
*/
return (bool)hints->input;
}