Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
xwm: allow applications to change focus between their own surfaces
Browse files Browse the repository at this point in the history
Although currently this problem is present in only Steam, and it is
actually a client bug.
  • Loading branch information
ammen99 authored and emersion committed Jan 5, 2020
1 parent 51f8c22 commit c067fbc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xwayland/xwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,17 @@ static void xwm_handle_focus_in(struct wlr_xwm *xwm,

// Do not let X clients change the focus behind the compositor's
// back. Reset the focus to the old one if it changed.
if (!xwm->focus_surface || ev->event != xwm->focus_surface->window_id) {
//
// Note: Some applications rely on being able to change focus, for ex. Steam:
// https://github.com/swaywm/sway/issues/1865
// 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 {
xwm->focus_surface = requested_focus;
}
}

Expand Down

0 comments on commit c067fbc

Please sign in to comment.