mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
feat:Avoid continuous rolling for scroller layout
This commit is contained in:
parent
ebcf633c45
commit
92e49ac67f
1 changed files with 18 additions and 1 deletions
19
maomao.c
19
maomao.c
|
|
@ -664,6 +664,7 @@ static Monitor *selmon;
|
||||||
static int enablegaps = 1; /* enables gaps, used by togglegaps */
|
static int enablegaps = 1; /* enables gaps, used by togglegaps */
|
||||||
static int axis_apply_time = 0;
|
static int axis_apply_time = 0;
|
||||||
static int axis_apply_dir = 0;
|
static int axis_apply_dir = 0;
|
||||||
|
static int scroller_focus_lock = 0;
|
||||||
|
|
||||||
/* global event handlers */
|
/* global event handlers */
|
||||||
static struct zdwl_ipc_manager_v2_interface dwl_manager_implementation = {
|
static struct zdwl_ipc_manager_v2_interface dwl_manager_implementation = {
|
||||||
|
|
@ -3907,6 +3908,7 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
|
||||||
LayerSurface *l = NULL;
|
LayerSurface *l = NULL;
|
||||||
struct wlr_surface *surface = NULL;
|
struct wlr_surface *surface = NULL;
|
||||||
struct wlr_pointer_constraint_v1 *constraint;
|
struct wlr_pointer_constraint_v1 *constraint;
|
||||||
|
bool should_lock = false;
|
||||||
|
|
||||||
/* Find the client under the pointer and send the event along. */
|
/* Find the client under the pointer and send the event along. */
|
||||||
xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy);
|
xytonode(cursor->x, cursor->y, &surface, &c, NULL, &sx, &sy);
|
||||||
|
|
@ -3980,7 +3982,22 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
|
||||||
if (!surface && !seat->drag)
|
if (!surface && !seat->drag)
|
||||||
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
|
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
|
||||||
|
|
||||||
pointerfocus(c, surface, sx, sy, time);
|
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)) {
|
||||||
|
scroller_focus_lock = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
should_lock = false;
|
||||||
|
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)) ) {
|
||||||
|
if(c && c->mon && strcmp(c->mon->pertag->ltidxs[selmon->pertag->curtag]->name,
|
||||||
|
"scroller") == 0 && (c->geom.x + c->geom.width > c->mon->m.x + c->mon->m.width || c->geom.x < c->mon->m.x)) {
|
||||||
|
should_lock = true;
|
||||||
|
}
|
||||||
|
pointerfocus(c, surface, sx, sy, time);
|
||||||
|
|
||||||
|
if(should_lock && c && c->mon && c == c->mon->sel) {
|
||||||
|
scroller_focus_lock = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue