diff options
author | Tudor Brindus <me@tbrindus.ca> | 2021-04-24 13:06:40 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-25 11:20:56 +0200 |
commit | 80128d23ba9f0a6a92284b2c6077e304f35e7a76 (patch) | |
tree | aaa439972d00b2c09d8a8a8188801bef7b117345 /sway/tree | |
parent | 8529141150ef2d9a07b9c0fad193bdbc12d3ad42 (diff) | |
download | sway-80128d23ba9f0a6a92284b2c6077e304f35e7a76.tar.xz |
tree/view: don't give focus to views mapped under fullscreen views
Fixes #6211.
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/view.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 43c37bda..32df19e5 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -600,6 +600,11 @@ static bool should_focus(struct sway_view *view) { return true; } + // View opened "under" fullscreen view should not be given focus. + if (root->fullscreen_global || map_ws->fullscreen) { + return false; + } + // Views can only take focus if they are mapped into the active workspace if (prev_ws != map_ws) { return false; @@ -758,7 +763,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, view_init_subsurfaces(view, wlr_surface); wl_signal_add(&wlr_surface->events.new_subsurface, - &view->surface_new_subsurface); + &view->surface_new_subsurface); view->surface_new_subsurface.notify = view_handle_surface_new_subsurface; if (decoration) { @@ -806,9 +811,9 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, #if HAVE_XWAYLAND if (wlr_surface_is_xwayland_surface(wlr_surface)) { struct wlr_xwayland_surface *xsurface = - wlr_xwayland_surface_from_wlr_surface(wlr_surface); - set_focus = (wlr_xwayland_icccm_input_model(xsurface) != - WLR_ICCCM_INPUT_MODEL_NONE) && set_focus; + wlr_xwayland_surface_from_wlr_surface(wlr_surface); + set_focus &= wlr_xwayland_icccm_input_model(xsurface) != + WLR_ICCCM_INPUT_MODEL_NONE; } #endif @@ -819,11 +824,9 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, const char *app_id; const char *class; if ((app_id = view_get_app_id(view)) != NULL) { - wlr_foreign_toplevel_handle_v1_set_app_id( - view->foreign_toplevel, app_id); + wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel, app_id); } else if ((class = view_get_class(view)) != NULL) { - wlr_foreign_toplevel_handle_v1_set_app_id( - view->foreign_toplevel, class); + wlr_foreign_toplevel_handle_v1_set_app_id(view->foreign_toplevel, class); } } |