patches

Patches for various other programs
git clone https://git.regexghost.com/patches.git
Log | Files | Refs | README

commit b76ff65d6ed0cf4b9599bb19341c7cbcc03b7486
parent ade1dca617e23fde1a39d1454bf923f73890d7e5
Author: regexghost <dev@regexghost.com>
Date:   Tue,  4 Aug 2026 21:49:53 +0100

added jwm patches, to mirror my fork

Diffstat:
Ajwm-border-flicker.diff | 13+++++++++++++
Ajwm-caps-lock.diff | 13+++++++++++++
Ajwm-centered.diff | 15+++++++++++++++
Ajwm-desktop-change.diff | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ajwm-move-unmap.diff | 38++++++++++++++++++++++++++++++++++++++
5 files changed, 163 insertions(+), 0 deletions(-)

diff --git a/jwm-border-flicker.diff b/jwm-border-flicker.diff @@ -0,0 +1,13 @@ +diff --git a/src/border.c b/src/border.c +index 256ba31..1c36209 100644 +--- a/src/border.c ++++ b/src/border.c +@@ -421,7 +421,7 @@ void DrawBorderHelper(const ClientNode *np) + } + + /* Set parent background to reduce flicker. */ +- JXSetWindowBackground(display, np->parent, titleColor2); ++ JXSetWindowBackground(display, np->parent, None); + + canvas = JXCreatePixmap(display, np->parent, width, north, rootDepth); + gc = JXCreateGC(display, canvas, 0, NULL); diff --git a/jwm-caps-lock.diff b/jwm-caps-lock.diff @@ -0,0 +1,13 @@ +diff --git a/src/binding.c b/src/binding.c +index 9515bfa..ff35318 100644 +--- a/src/binding.c ++++ b/src/binding.c +@@ -66,7 +66,7 @@ typedef struct LockNode { + } LockNode; + + static LockNode lockMods[] = { +- { XK_Caps_Lock, 0 }, ++// { XK_Caps_Lock, 0 }, + { XK_Num_Lock, 0 } + }; + diff --git a/jwm-centered.diff b/jwm-centered.diff @@ -0,0 +1,15 @@ +diff --git a/src/place.c b/src/place.c +index 74ddb3a..959f394 100644 +--- a/src/place.c ++++ b/src/place.c +@@ -663,8 +663,8 @@ void PlaceClient(ClientNode *np, char alreadyMapped) + SubtractTrayBounds(&box, np->state.layer); + SubtractStrutBounds(&box, np); + +- /* If tiled is specified, first attempt to use tiled placement. */ +- if(np->state.status & STAT_TILED) { ++ /* If tiled is specified, use, unless centered is specified. */ ++ if(np->state.status & STAT_TILED && !(np->state.status & STAT_CENTERED)) { + if(TileClient(&box, np)) { + return; + } diff --git a/jwm-desktop-change.diff b/jwm-desktop-change.diff @@ -0,0 +1,84 @@ +diff --git a/src/client.c b/src/client.c +index 4856fd4..82ef774 100644 +--- a/src/client.c ++++ b/src/client.c +@@ -37,6 +37,10 @@ static void RestoreTransients(ClientNode *np, char raise); + static void KillClientHandler(ClientNode *np); + static void UnmapClient(ClientNode *np); + ++void UnsetActiveClient() { ++ activeClient = NULL; ++} ++ + /** Load windows that are already mapped. */ + void StartupClients(void) + { +diff --git a/src/client.h b/src/client.h +index 6be5353..30bc590 100644 +--- a/src/client.h ++++ b/src/client.h +@@ -166,6 +166,10 @@ typedef struct ClientNode { + /** The number of clients (maintained in client.c). */ + extern unsigned int clientCount; + ++/** Unset the activeClient variable ++ */ ++void UnsetActiveClient(void); ++ + /** Find a client by window or parent window. + * @param w The window. + * @return The client (NULL if not found). +diff --git a/src/desktop.c b/src/desktop.c +index 1a136ca..4e5a502 100644 +--- a/src/desktop.c ++++ b/src/desktop.c +@@ -165,20 +165,12 @@ void ChangeDesktop(unsigned int desktop) + return; + } + +- /* Hide clients from the old desktop. +- * Note that we show clients in a separate loop to prevent an issue +- * with clients losing focus. +- */ ++ /* Unset active client */ + for(x = 0; x < LAYER_COUNT; x++) { + for(np = nodes[x]; np; np = np->next) { +- if(np->state.status & STAT_STICKY) { +- continue; +- } +- if(np->state.desktop == currentDesktop) { +- HideClient(np); +- if((np->state.status & STAT_MINIMIZED) && (np->state.status & STAT_ACTIVE)) { +- np->state.status &= ~STAT_ACTIVE; +- } ++ if (np->state.desktop == currentDesktop && np == GetActiveClient()) { ++ UnsetActiveClient(); ++ break; + } + } + } +@@ -195,6 +187,24 @@ void ChangeDesktop(unsigned int desktop) + } + } + ++ /* Hide clients from the old desktop. ++ * Note that we show clients in a separate loop to prevent an issue ++ * with clients losing focus. ++ */ ++ for(x = 0; x < LAYER_COUNT; x++) { ++ for(np = nodes[x]; np; np = np->next) { ++ if(np->state.status & STAT_STICKY) { ++ continue; ++ } ++ if(np->state.desktop == currentDesktop) { ++ HideClient(np); ++ if((np->state.status & STAT_MINIMIZED) && (np->state.status & STAT_ACTIVE)) { ++ np->state.status &= ~STAT_ACTIVE; ++ } ++ } ++ } ++ } ++ + previousDesktop = currentDesktop; + currentDesktop = desktop; + diff --git a/jwm-move-unmap.diff b/jwm-move-unmap.diff @@ -0,0 +1,38 @@ +diff --git a/src/client.c b/src/client.c +index 82ef774..4c6e779 100644 +--- a/src/client.c ++++ b/src/client.c +@@ -643,10 +643,14 @@ void HideClient(ClientNode *np) + } + np->state.status |= STAT_HIDDEN; + if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { ++ int north, south, east, west; ++ GetBorderSize(&np->state, &north, &south, &east, &west); + if(np->parent != None) { +- JXUnmapWindow(display, np->parent); ++ JXMoveWindow(display, np->parent, -np->width - 200, np->y - north); ++// JXUnmapWindow(display, np->parent); + } else { +- JXUnmapWindow(display, np->window); ++ JXMoveWindow(display, np->window, -np->width - 200, np->y - north); ++// JXUnmapWindow(display, np->window); + } + } + } +@@ -659,10 +663,14 @@ void ShowClient(ClientNode *np) + np->state.status &= ~STAT_HIDDEN; + if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { + if(!(np->state.status & STAT_MINIMIZED)) { ++ int north, south, east, west; ++ GetBorderSize(&np->state, &north, &south, &east, &west); + if(np->parent != None) { +- JXMapWindow(display, np->parent); ++ JXMoveWindow(display, np->parent, np->x - west, np->y - north); ++// JXMapWindow(display, np->parent); + } else { +- JXMapWindow(display, np->window); ++ JXMoveWindow(display, np->parent, np->x - west, np->y - north); ++// JXMapWindow(display, np->window); + } + if(np->state.status & STAT_ACTIVE) { + FocusClient(np);