[wiki] [sites] Add customrefreshrate patch to dwm patches repository. || moonsabre
commit cf6279c687765a4571cdf166e7bb9f91fc5af44e
Author: moonsabre <moonsabre_AT_tuta.io>
Date: Thu Mar 27 12:06:42 2025 -0700
Add customrefreshrate patch to dwm patches repository.
diff --git a/dwm.suckless.org/patches/customrefreshrate/dwm-customrefreshrate-6.5.diff b/dwm.suckless.org/patches/customrefreshrate/dwm-customrefreshrate-6.5.diff
new file mode 100644
index 00000000..c84c3caf
--- /dev/null
+++ b/dwm.suckless.org/patches/customrefreshrate/dwm-customrefreshrate-6.5.diff
_AT_@ -0,0 +1,47 @@
+From d443eec1ead848777b49906ed2a962bfd8b8559d Mon Sep 17 00:00:00 2001
+From: moonsabre <moonsabre_AT_tuta.io>
+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
+_AT_@ -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
+_AT_@ -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;
+
+_AT_@ -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
+
diff --git a/dwm.suckless.org/patches/customrefreshrate/index.md b/dwm.suckless.org/patches/customrefreshrate/index.md
new file mode 100644
index 00000000..79b4abd3
--- /dev/null
+++ b/dwm.suckless.org/patches/customrefreshrate/index.md
_AT_@ -0,0 +1,15 @@
+# customrefreshrate
+
+## Description
+
+This simple patch aims to make window dragging & resizing smoother by allowing the user to sync dwm's internal refresh rate with the refresh rate of their monitor.
+
+To set a custom refresh rate, edit the *refreshrate* variable in config.h. The default is 60 frames per second.
+
+## Download
+
+* [dwm-customrefreshrate-6.5.diff](dwm-customrefreshrate-6.5.diff) (2025-03-27)
+
+## Author
+
+* [moonsabre](mailto:moonsabre_AT_tuta.io)
Received on Thu Mar 27 2025 - 20:05:54 CET
This archive was generated by hypermail 2.3.0
: Thu Mar 27 2025 - 20:12:54 CET