mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-29 21:37:42 -04:00
feat: add option edge_scroller_focus_allow_speed
This commit is contained in:
parent
0950d4da9e
commit
62ff542334
4 changed files with 19 additions and 2 deletions
12
src/mango.c
12
src/mango.c
|
|
@ -4723,14 +4723,22 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
|||
}
|
||||
|
||||
should_lock = false;
|
||||
double speed = 0.0f;
|
||||
|
||||
if (config.edge_scroller_pointer_focus) {
|
||||
speed = sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
|
||||
if (!scroller_focus_lock || !(c && c->mon && !INSIDEMON(c))) {
|
||||
if (c && c->mon && is_scroller_layout(c->mon) && !INSIDEMON(c)) {
|
||||
should_lock = true;
|
||||
}
|
||||
|
||||
if (!(!config.edge_scroller_pointer_focus && c && c->mon &&
|
||||
is_scroller_layout(c->mon) && !INSIDEMON(c)))
|
||||
if (!((!config.edge_scroller_pointer_focus ||
|
||||
speed < config.edge_scroller_focus_allow_speed) &&
|
||||
c && c->mon && is_scroller_layout(c->mon) && !INSIDEMON(c))) {
|
||||
pointerfocus(c, surface, sx, sy, time);
|
||||
}
|
||||
|
||||
if (should_lock && c && c->mon && ISTILED(c) && c == c->mon->sel) {
|
||||
scroller_focus_lock = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue