mirror of
https://github.com/labwc/labwc.git
synced 2026-02-12 04:27:57 -05:00
desktop: allow re-focus between "globally active" views of the same PID
Commit7e72bf975fchanged behavior to not automatically focus xwayland views using the "Globally Active" input model (WM_HINTS.inputs = false but WM_TAKE_FOCUS listed in WM_PROTOCOLS). One undesired side effect of this change is that when a dialog is closed, the parent window is not re-focused if "Globally Active". This issue is seen for example with JDownloader. It can be solved taking a similar approach to what is done for unmanaged xwayland views: allow automatic re-focus between views sharing the same PID. Note that it's difficult to completely solve all of the focus issues with Globally Active views without proper WM_TAKE_FOCUS support. Implementing proper support is difficult since it requires wlroots changes and would also mean waiting for a message round-trip in desktop_focus_topmost_view(). Fixes (partially):7e72bf975f("view/xwayland: avoid focusing views that don't want focus")
This commit is contained in:
parent
dd7f563a50
commit
f6e3527767
3 changed files with 30 additions and 5 deletions
|
|
@ -192,6 +192,8 @@ desktop_cycle_view(struct server *server, struct view *start_view,
|
|||
struct view *
|
||||
desktop_topmost_focusable_view(struct server *server)
|
||||
{
|
||||
struct wlr_surface *prev =
|
||||
server->seat.seat->keyboard_state.focused_surface;
|
||||
struct view *view;
|
||||
struct wl_list *node_list;
|
||||
struct wlr_scene_node *node;
|
||||
|
|
@ -202,7 +204,7 @@ desktop_topmost_focusable_view(struct server *server)
|
|||
continue;
|
||||
}
|
||||
view = node_view_from_node(node);
|
||||
if (view->mapped && view_is_focusable(view)) {
|
||||
if (view->mapped && view_is_focusable_from(view, prev)) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue