mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-25 06:46:30 -04:00
active constraint nesting for input capture
This commit is contained in:
parent
4b8603181c
commit
ac61923e2f
1 changed files with 14 additions and 11 deletions
25
src/mango.c
25
src/mango.c
|
|
@ -4384,20 +4384,23 @@ 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) {
|
|
||||||
sx = cursor->x - c->geom.x - c->bw;
|
|
||||||
sy = cursor->y - c->geom.y - c->bw;
|
|
||||||
if (wlr_region_confine(&active_constraint->region, sx, sy,
|
|
||||||
sx + dx, sy + dy, &sx_confined,
|
|
||||||
&sy_confined)) {
|
|
||||||
dx = sx_confined - sx;
|
|
||||||
dy = sy_confined - sy;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
|
if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
toplevel_from_wlr_surface(active_constraint->surface, &c, NULL);
|
||||||
|
if (c) {
|
||||||
|
sx = cursor->x - c->geom.x - c->bw;
|
||||||
|
sy = cursor->y - c->geom.y - c->bw;
|
||||||
|
if (wlr_region_confine(&active_constraint->region, sx, sy,
|
||||||
|
sx + dx, sy + dy, &sx_confined,
|
||||||
|
&sy_confined)) {
|
||||||
|
dx = sx_confined - sx;
|
||||||
|
dy = sy_confined - sy;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue