[wiki] [sites] adjusted dmenu gridnav patch for 5.2 || Nik-Nothing
commit 8700e556cc3d641483c57dd43afd7a37a0a7450a
Author: Nik-Nothing <niktopel_AT_gmail.com>
Date: Fri Jan 20 13:19:05 2023 +0000
adjusted dmenu gridnav patch for 5.2
diff --git a/tools.suckless.org/dmenu/patches/gridnav/dmenu-gridnav-5.2.diff b/tools.suckless.org/dmenu/patches/gridnav/dmenu-gridnav-5.2.diff
new file mode 100644
index 00000000..7adc36f8
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/gridnav/dmenu-gridnav-5.2.diff
_AT_@ -0,0 +1,69 @@
+diff --git a/dmenu.c b/dmenu.c
+index 027dddb..0b92f1f 100644
+--- a/dmenu.c
++++ b/dmenu.c
+_AT_@ -334,6 +334,8 @@ keypress(XKeyEvent *ev)
+ int len;
+ KeySym ksym = NoSymbol;
+ Status status;
++ int i, offscreen = 0;
++ struct item *tmpsel;
+
+ len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
+ switch (status) {
+_AT_@ -465,6 +467,27 @@ insert:
+ calcoffsets();
+ break;
+ case XK_Left:
++ if (columns > 1) {
++ if (!sel)
++ return;
++ tmpsel = sel;
++ for (i = 0; i < lines; i++) {
++ if (!tmpsel->left || tmpsel->left->right != tmpsel) {
++ if (offscreen)
++ break;
++ return;
++ }
++ if (tmpsel == curr)
++ offscreen = 1;
++ tmpsel = tmpsel->left;
++ }
++ sel = tmpsel;
++ if (offscreen) {
++ curr = prev;
++ calcoffsets();
++ }
++ break;
++ }
+ case XK_KP_Left:
+ if (cursor > 0 && (!sel || !sel->left || lines > 0)) {
+ cursor = nextrune(-1);
+_AT_@ -505,6 +528,27 @@ insert:
+ sel->out = 1;
+ break;
+ case XK_Right:
++ if (columns > 1) {
++ if (!sel)
++ return;
++ tmpsel = sel;
++ for (i = 0; i < lines; i++) {
++ if (!tmpsel->right || tmpsel->right->left != tmpsel) {
++ if (offscreen)
++ break;
++ return;
++ }
++ tmpsel = tmpsel->right;
++ if (tmpsel == next)
++ offscreen = 1;
++ }
++ sel = tmpsel;
++ if (offscreen) {
++ curr = next;
++ calcoffsets();
++ }
++ break;
++ }
+ case XK_KP_Right:
+ if (text[cursor] != '+ cursor = nextrune(+1);
diff --git a/tools.suckless.org/dmenu/patches/gridnav/index.md b/tools.suckless.org/dmenu/patches/gridnav/index.md
index 23d29773..84a6b400 100644
--- a/tools.suckless.org/dmenu/patches/gridnav/index.md
+++ b/tools.suckless.org/dmenu/patches/gridnav/index.md
_AT_@ -6,6 +6,7 @@ Apply this patch after grid.
Download
--------
* [dmenu-gridnav-5.0.diff](dmenu-gridnav-5.0.diff)
+* [dmenu-gridnav-5.2.diff](dmenu-gridnav-5.2.diff)
Author
------
Received on Fri Jan 20 2023 - 14:20:15 CET
This archive was generated by hypermail 2.3.0
: Fri Jan 20 2023 - 14:24:46 CET