mirror of
https://github.com/labwc/labwc.git
synced 2026-03-01 01:40:24 -05:00
desktop: try harder to avoid focusing unfocusable views
Make desktop_focus_view() do nothing if the view is not focusable.
This commit is contained in:
parent
7e72bf975f
commit
cae96b0cce
1 changed files with 11 additions and 7 deletions
|
|
@ -38,14 +38,16 @@ void
|
||||||
desktop_focus_view(struct view *view, bool raise)
|
desktop_focus_view(struct view *view, bool raise)
|
||||||
{
|
{
|
||||||
assert(view);
|
assert(view);
|
||||||
|
if (!view_isfocusable(view)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Guard against views with no mapped surfaces when handling
|
* Guard against views with no mapped surfaces when handling
|
||||||
* 'request_activate' and 'request_minimize'.
|
* 'request_activate' and 'request_minimize'.
|
||||||
* See notes by view_isfocusable()
|
* view_isfocusable() should return false for those views.
|
||||||
*/
|
*/
|
||||||
if (!view->surface) {
|
assert(view->surface);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct server *server = view->server;
|
struct server *server = view->server;
|
||||||
if (input_inhibit_blocks_surface(&server->seat, view->surface->resource)
|
if (input_inhibit_blocks_surface(&server->seat, view->surface->resource)
|
||||||
|
|
@ -62,9 +64,11 @@ desktop_focus_view(struct view *view, bool raise)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!view->mapped) {
|
/*
|
||||||
return;
|
* view_isfocusable() should return false for any views that are
|
||||||
}
|
* neither mapped nor minimized.
|
||||||
|
*/
|
||||||
|
assert(view->mapped);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Switch workspace if necessary to make the view visible
|
* Switch workspace if necessary to make the view visible
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue