PointerConstraint: remove overly tight assert

This assert is incorrect if Xwayland is enabled and an Override Redirect
window steals the keyboard focus from the parent surface.

It also seems likely to be hit if a Wayland client attempts to use a
pointer constraint on a subsurface. I don't think a pointer constraint
on a subsurface is likely to work entirely correctly and I don't know of
any Wayland clients that try such a thing. We can't let them crash river
by trying though.

(cherry picked from commit 5d1fc034bc6aedc340671d5de76add308effd2e8)
This commit is contained in:
Isaac Freund 2024-05-18 14:40:20 +02:00
parent fa077d31b4
commit 7b42c38276
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -105,8 +105,6 @@ pub fn maybeActivate(constraint: *PointerConstraint) void {
pub fn updateState(constraint: *PointerConstraint) void { pub fn updateState(constraint: *PointerConstraint) void {
const seat: *Seat = @ptrFromInt(constraint.wlr_constraint.seat.data); const seat: *Seat = @ptrFromInt(constraint.wlr_constraint.seat.data);
assert(seat.wlr_seat.keyboard_state.focused_surface == constraint.wlr_constraint.surface);
constraint.maybeActivate(); constraint.maybeActivate();
if (constraint.state != .active) return; if (constraint.state != .active) return;