mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Revert "desktop: try harder to avoid focusing unfocusable views"
Some X11 applications (MATLAB is known to be one) apparently still use
the outdated "globally active" input focus model, in which they declare
they don't want the window manager to give them input focus, but expect
to be able to take it explicitly themselves via XSetInputFocus().
Such applications are not a good fit for the Wayland world, and may have
issues even with remotely modern X11 window managers that prevent such
"focus stealing". Labwc certainly doesn't (and won't) allow it. However,
to avoid breaking such applications entirely, let's still allow the user
to give focus by clicking in the window.
For the sake of applications that legitimately don't want to be given
input focus (such as taskbars or other "panels"), we still don't give
focus to them automatically when another view is closed, and they aren't
shown in Alt-Tab.
This reverts commit cae96b0cce.
This commit is contained in:
parent
db41b5eec0
commit
9be6bd8b1d
1 changed files with 6 additions and 11 deletions
|
|
@ -38,16 +38,13 @@ void
|
|||
desktop_focus_view(struct view *view, bool raise)
|
||||
{
|
||||
assert(view);
|
||||
if (!view_isfocusable(view)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Guard against views with no mapped surfaces when handling
|
||||
* 'request_activate' and 'request_minimize'.
|
||||
* view_isfocusable() should return false for those views.
|
||||
*/
|
||||
assert(view->surface);
|
||||
if (!view->surface) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct server *server = view->server;
|
||||
if (input_inhibit_blocks_surface(&server->seat, view->surface->resource)
|
||||
|
|
@ -64,11 +61,9 @@ desktop_focus_view(struct view *view, bool raise)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* view_isfocusable() should return false for any views that are
|
||||
* neither mapped nor minimized.
|
||||
*/
|
||||
assert(view->mapped);
|
||||
if (!view->mapped) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Switch workspace if necessary to make the view visible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue