diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-05-23 10:41:20 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-05-25 21:39:01 +0200 |
commit | 0758a4fc9dac7a887517a40f31daaaf12540b7f5 (patch) | |
tree | d3438b0f78089a5edbbd2dbd5f845c496c1db014 /xwayland | |
parent | 5c942bd5972afee9a68cb15c14aa83b4b0aaf82d (diff) |
xwayland: send focus change event unconditionally
This fixes issues with (at least) dialogs in Jetbrains IDEs becoming
unclickable if they ever lost focus (ref. swaywm/sway#5373). Prior to
this change, since `xwm->focus_surface` would be set prior to
`xwm_surface_activate` being called, the latter would short-circuit
immediately and not notify the application of the focus change.
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/xwm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 76175e5d..6846c76f 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1243,12 +1243,12 @@ static void xwm_handle_focus_in(struct wlr_xwm *xwm, // Because of that, we allow changing focus between surfaces belonging to the // same application. struct wlr_xwayland_surface *requested_focus = lookup_surface(xwm, ev->event); - if (!xwm->focus_surface || !requested_focus || - requested_focus->pid != xwm->focus_surface->pid) { - xwm_send_focus_window(xwm, xwm->focus_surface); - } else { + if (xwm->focus_surface && requested_focus && + requested_focus->pid == xwm->focus_surface->pid) { xwm->focus_surface = requested_focus; } + + xwm_send_focus_window(xwm, xwm->focus_surface); } static void xwm_handle_xcb_error(struct wlr_xwm *xwm, xcb_value_error_t *ev) { |