aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar BrassyPanache <brassy.panache@gmail.com>2021-01-13 00:56:33 +1100
committerLibravatar Simon Ser <contact@emersion.fr>2021-01-20 10:50:04 +0100
commit62ec528c8cd6d2f7a70412b632ece65cbd6883b6 (patch)
tree8f3764929d04c596ea74bb4c02d9c1295b480672
parentLog when config file is not found (diff)
downloadsway-62ec528c8cd6d2f7a70412b632ece65cbd6883b6.tar.gz
sway-62ec528c8cd6d2f7a70412b632ece65cbd6883b6.tar.zst
sway-62ec528c8cd6d2f7a70412b632ece65cbd6883b6.zip
Adhere to ICCCM focus specification
For certain applications (e.g. JetBrains) the parent window controls input. We need to adhere to the ICCCM input focus specification to properly handle these cases. Relates to swaywm/wlroots#2604
-rw-r--r--sway/tree/view.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 07ca3dff..7afcdf31 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -785,7 +785,18 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
785 785
786 view_execute_criteria(view); 786 view_execute_criteria(view);
787 787
788 if (should_focus(view)) { 788 bool set_focus = should_focus(view);
789
790#if HAVE_XWAYLAND
791 if (wlr_surface_is_xwayland_surface(wlr_surface)) {
792 struct wlr_xwayland_surface *xsurface =
793 wlr_xwayland_surface_from_wlr_surface(wlr_surface);
794 set_focus = (wlr_xwayland_icccm_input_model(xsurface) !=
795 WLR_ICCCM_INPUT_MODEL_NONE) && set_focus;
796 }
797#endif
798
799 if (set_focus) {
789 input_manager_set_focus(&view->container->node); 800 input_manager_set_focus(&view->container->node);
790 } 801 }
791 802