mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 16:36:26 +01:00
xwayland: simplify override-redirect focus restoration
No need to grab the xwayland surface from the wlr_surface, the parent is already an xwayland surface.
This commit is contained in:
parent
ba6c0eb18b
commit
585abdb357
1 changed files with 4 additions and 8 deletions
|
@ -105,15 +105,11 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
|
||||||
if (seat->wlr_seat->keyboard_state.focused_surface == xsurface->surface) {
|
if (seat->wlr_seat->keyboard_state.focused_surface == xsurface->surface) {
|
||||||
// This simply returns focus to the parent surface if there's one available.
|
// This simply returns focus to the parent surface if there's one available.
|
||||||
// This seems to handle JetBrains issues.
|
// This seems to handle JetBrains issues.
|
||||||
if (xsurface->parent && xsurface->parent->surface &&
|
if (xsurface->parent && xsurface->parent->surface
|
||||||
wlr_surface_is_xwayland_surface(xsurface->parent->surface)) {
|
&& wlr_xwayland_or_surface_wants_focus(xsurface->parent)) {
|
||||||
struct wlr_xwayland_surface *next_surface =
|
|
||||||
wlr_xwayland_surface_from_wlr_surface(xsurface->parent->surface);
|
|
||||||
if (wlr_xwayland_or_surface_wants_focus(next_surface)) {
|
|
||||||
seat_set_focus_surface(seat, xsurface->parent->surface, false);
|
seat_set_focus_surface(seat, xsurface->parent->surface, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Restore focus
|
// Restore focus
|
||||||
struct sway_node *previous = seat_get_focus_inactive(seat, &root->node);
|
struct sway_node *previous = seat_get_focus_inactive(seat, &root->node);
|
||||||
|
|
Loading…
Reference in a new issue