opt: reduce cursor resize request

This commit is contained in:
DreamMaoMao
2025-12-19 23:08:19 +08:00
parent a67083bdb4
commit df0e18481b
2 changed files with 6 additions and 2 deletions

View File

@@ -106,7 +106,7 @@ int xwayland_persistence = 1; /* xwayland persistence */
int syncobj_enable = 0; int syncobj_enable = 0;
int adaptive_sync = 0; int adaptive_sync = 0;
int allow_lock_transparent = 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_tearing = TEARING_DISABLED;
int allow_shortcuts_inhibit = SHORTCUTS_INHIBIT_ENABLE; int allow_shortcuts_inhibit = SHORTCUTS_INHIBIT_ENABLE;

View File

@@ -4035,7 +4035,11 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
.y = grabc->geom.y, .y = grabc->geom.y,
.width = (int)round(cursor->x) - grabc->geom.x, .width = (int)round(cursor->x) - grabc->geom.x,
.height = (int)round(cursor->y) - grabc->geom.y}; .height = (int)round(cursor->y) - grabc->geom.y};
if (last_apply_drap_time == 0 ||
time - last_apply_drap_time > drag_refresh_interval) {
resize(grabc, grabc->float_geom, 1); resize(grabc, grabc->float_geom, 1);
last_apply_drap_time = time;
}
return; return;
} else { } else {
resize_tile_client(grabc, true, 0, 0, time); resize_tile_client(grabc, true, 0, 0, time);