Seat: rework Xwayland Override Redirect focus
Instead of stashing the active view and setting Seat.focused to the Xwayland OR surface when a child OR surface of a currently focused Xwayland view is given keyboard focus, keep Seat.focused set to the Xwayland view. Such Override Redirect surfaces are commonly used for drop down menus and the like, and river should behave as if the parent Xwayland view still has focus. This ensures that the riverctl focus-view next/prev commands continue to work as expected while a popup is open, the correct focused view title will be sent over river status, etc. It's also cleaner to centralize this logic in XwaylandOverrideRedirect and keep it out of Seat.zig.
This commit is contained in:
@ -367,12 +367,8 @@ fn updateKeyboardFocus(self: Self, result: SurfaceAtResult) void {
|
||||
self.seat.setFocusRaw(.{ .lock_surface = lock_surface });
|
||||
},
|
||||
.xwayland_override_redirect => |override_redirect| {
|
||||
if (!build_options.xwayland) unreachable;
|
||||
if (override_redirect.xwayland_surface.overrideRedirectWantsFocus() and
|
||||
override_redirect.xwayland_surface.icccmInputModel() != .none)
|
||||
{
|
||||
self.seat.setFocusRaw(.{ .xwayland_override_redirect = override_redirect });
|
||||
}
|
||||
assert(server.lock_manager.state != .unlocked);
|
||||
override_redirect.focusIfDesired();
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -663,7 +659,7 @@ const SurfaceAtResult = struct {
|
||||
view: *View,
|
||||
layer_surface: *LayerSurface,
|
||||
lock_surface: *LockSurface,
|
||||
xwayland_override_redirect: if (build_options.xwayland) *XwaylandOverrideRedirect else void,
|
||||
xwayland_override_redirect: if (build_options.xwayland) *XwaylandOverrideRedirect else noreturn,
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user