mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat: add vertical scroller lock to pointer focus
This commit is contained in:
parent
055157406b
commit
766adc4c10
1 changed files with 9 additions and 3 deletions
12
src/maomao.c
12
src/maomao.c
|
|
@ -4842,7 +4842,9 @@ void motionnotify(unsigned int time, struct wlr_input_device *device, double dx,
|
|||
|
||||
if (c && c->mon && !c->animation.running &&
|
||||
(!(c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width ||
|
||||
c->geom.x < c->mon->m.x) ||
|
||||
c->geom.x < c->mon->m.x ||
|
||||
c->geom.y + c->geom.height > c->mon->m.y + c->mon->m.height ||
|
||||
c->geom.y < c->mon->m.y) ||
|
||||
!ISTILED(c))) {
|
||||
scroller_focus_lock = 0;
|
||||
}
|
||||
|
|
@ -4851,10 +4853,14 @@ void motionnotify(unsigned int time, struct wlr_input_device *device, double dx,
|
|||
if (!scroller_focus_lock ||
|
||||
!(c && c->mon &&
|
||||
(c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width ||
|
||||
c->geom.x < c->mon->m.x))) {
|
||||
c->geom.x < c->mon->m.x ||
|
||||
c->geom.y + c->geom.height > c->mon->m.y + c->mon->m.height ||
|
||||
c->geom.y < c->mon->m.y))) {
|
||||
if (c && c->mon && is_scroller_layout(c->mon) &&
|
||||
(c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width ||
|
||||
c->geom.x < c->mon->m.x)) {
|
||||
c->geom.x < c->mon->m.x ||
|
||||
c->geom.y + c->geom.height > c->mon->m.y + c->mon->m.height ||
|
||||
c->geom.y < c->mon->m.y)) {
|
||||
should_lock = true;
|
||||
}
|
||||
pointerfocus(c, surface, sx, sy, time);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue