From df0e18481b0cdf9b216186c26e00de126550474b Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Fri, 19 Dec 2025 23:08:19 +0800 Subject: [PATCH] opt: reduce cursor resize request --- src/config/preset.h | 2 +- src/mango.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config/preset.h b/src/config/preset.h index a371a42..31f514f 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -106,7 +106,7 @@ int xwayland_persistence = 1; /* xwayland persistence */ int syncobj_enable = 0; int adaptive_sync = 0; int allow_lock_transparent = 0; -double drag_refresh_interval = 30.0; +double drag_refresh_interval = 16.0; int allow_tearing = TEARING_DISABLED; int allow_shortcuts_inhibit = SHORTCUTS_INHIBIT_ENABLE; diff --git a/src/mango.c b/src/mango.c index 5a9a5ad..4d685ec 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4035,7 +4035,11 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx, .y = grabc->geom.y, .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}; - resize(grabc, grabc->float_geom, 1); + if (last_apply_drap_time == 0 || + time - last_apply_drap_time > drag_refresh_interval) { + resize(grabc, grabc->float_geom, 1); + last_apply_drap_time = time; + } return; } else { resize_tile_client(grabc, true, 0, 0, time);