From d443eec1ead848777b49906ed2a962bfd8b8559d Mon Sep 17 00:00:00 2001 From: moonsabre Date: Thu, 27 Mar 2025 11:33:41 -0700 Subject: [PATCH] Add custom refresh rate parameter. --- config.def.h | 1 + dwm.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index 9efa774..a70b081 100644 --- a/config.def.h +++ b/config.def.h @@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ +static const int refreshrate = 60; /* Update rate for drag and resize events, in updates (frames) per second */ static const char *fonts[] = { "monospace:size=10" }; static const char dmenufont[] = "monospace:size=10"; static const char col_gray1[] = "#222222"; diff --git a/dwm.c b/dwm.c index 1443802..4cf07eb 100644 --- a/dwm.c +++ b/dwm.c @@ -1171,7 +1171,7 @@ movemouse(const Arg *arg) handler[ev.type](&ev); break; case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) + if ((ev.xmotion.time - lasttime) <= (1000 / refreshrate)) continue; lasttime = ev.xmotion.time; @@ -1325,7 +1325,7 @@ resizemouse(const Arg *arg) handler[ev.type](&ev); break; case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) + if ((ev.xmotion.time - lasttime) <= (1000 / refreshrate)) continue; lasttime = ev.xmotion.time; -- 2.49.0