mirror of
https://github.com/labwc/labwc.git
synced 2026-02-16 22:05:27 -05:00
view/xwayland: avoid focusing views that don't want focus
XWayland views can self-declare that they don't want keyboard focus via the ICCCM WM_HINTS property. Most of the logic is already in place to avoid giving focus to such views (e.g. taskbars). Add a couple of missing pieces to make this work: - Hook up view_isfocusable() to look at WM_HINTS for XWayland views - Adjust desktop_focus_topmost_mapped_view() to skip unfocusable views
This commit is contained in:
parent
d503370a77
commit
7e72bf975f
10 changed files with 29 additions and 13 deletions
|
|
@ -190,7 +190,7 @@ desktop_cycle_view(struct server *server, struct view *start_view,
|
|||
}
|
||||
|
||||
struct view *
|
||||
desktop_topmost_mapped_view(struct server *server)
|
||||
desktop_topmost_focusable_view(struct server *server)
|
||||
{
|
||||
struct view *view;
|
||||
struct wl_list *node_list;
|
||||
|
|
@ -202,7 +202,7 @@ desktop_topmost_mapped_view(struct server *server)
|
|||
continue;
|
||||
}
|
||||
view = node_view_from_node(node);
|
||||
if (view->mapped) {
|
||||
if (view->mapped && view_isfocusable(view)) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
|
@ -210,9 +210,9 @@ desktop_topmost_mapped_view(struct server *server)
|
|||
}
|
||||
|
||||
void
|
||||
desktop_focus_topmost_mapped_view(struct server *server)
|
||||
desktop_focus_topmost_view(struct server *server)
|
||||
{
|
||||
struct view *view = desktop_topmost_mapped_view(server);
|
||||
struct view *view = desktop_topmost_focusable_view(server);
|
||||
if (view) {
|
||||
desktop_focus_view(view, /*raise*/ true);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue