Merge pull request #865 from mdouda/main

pointer constraint handling for layer-shell surfaces (lan-mouse input retain issue)
This commit is contained in:
DreamMaoMao 2026-04-23 23:31:23 +08:00 committed by GitHub
commit 2512e84671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4384,9 +4384,14 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
if (active_constraint && cursor_mode != CurResize && if (active_constraint && cursor_mode != CurResize &&
cursor_mode != CurMove) { cursor_mode != CurMove) {
toplevel_from_wlr_surface(active_constraint->surface, &c, NULL); if (active_constraint->surface ==
if (c && active_constraint->surface ==
seat->pointer_state.focused_surface) { seat->pointer_state.focused_surface) {
if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
return;
toplevel_from_wlr_surface(active_constraint->surface, &c, NULL);
if (c) {
sx = cursor->x - c->geom.x - c->bw; sx = cursor->x - c->geom.x - c->bw;
sy = cursor->y - c->geom.y - c->bw; sy = cursor->y - c->geom.y - c->bw;
if (wlr_region_confine(&active_constraint->region, sx, sy, if (wlr_region_confine(&active_constraint->region, sx, sy,
@ -4395,9 +4400,7 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
dx = sx_confined - sx; dx = sx_confined - sx;
dy = sy_confined - sy; dy = sy_confined - sy;
} }
}
if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
return;
} }
} }