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
cae96b0cce441dd9f1981c312ae0108b3b4e42c9.
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)
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