shod

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9ed6e6559b059a2a0e932c2568f9f5691361cc48
parent ee649f21448c76af5a4c22d22f3aeedbba5a85cd
Author: Lucas de Sena <lucas@seninha.org>
Date:   Sun,  9 Apr 2023 21:42:25 -0300

dont reset number of desktops after initialization

Diffstat:
Mshod.c | 20++++++++++++++++++++
Mxdraw.c | 4----
Mxevents.c | 4++--
3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/shod.c b/shod.c @@ -193,7 +193,9 @@ initxrm(void) RESOURCES #undef X }; + long n; int i; + char *value; XrmInitialize(); wm.application.class = XrmPermStringToQuark("Shod"); @@ -206,6 +208,24 @@ initxrm(void) if (!settheme()) exit(EXIT_FAILURE); setresources(XResourceManagerString(dpy)); + if (xdb != NULL) { + value = getresource( + xdb, + (XrmClass[]){ + wm.application.class, + wm.resources[RES_NDESKTOPS].class, + NULLQUARK, + }, + (XrmName[]){ + wm.application.name, + wm.resources[RES_NDESKTOPS].name, + NULLQUARK, + } + ); + if (value != NULL && (n = strtol(value, NULL, 10)) > 0 && n < 100) { + config.ndesktops = n; + } + } } /* set up root window */ diff --git a/xdraw.c b/xdraw.c @@ -892,10 +892,6 @@ setresources(char *xrm) case RES_NOTIFY_GRAVITY: config.notifgravity = value; break; - case RES_NDESKTOPS: - if ((n = strtol(value, NULL, 10)) > 0 && n < 100) - config.ndesktops = n; - break; case RES_SNAP_PROXIMITY: if ((n = strtol(value, NULL, 10)) >= 0 && n < 100) config.snap = n; diff --git a/xevents.c b/xevents.c @@ -1780,6 +1780,8 @@ xeventpropertynotify(XEvent *e) char *str; ev = &e->xproperty; + if (ev->state != PropertyNewValue) + return; if (ev->window == root && ev->atom == XA_RESOURCE_MANAGER) { if ((str = gettextprop(root, XA_RESOURCE_MANAGER)) == NULL) return; @@ -1795,8 +1797,6 @@ xeventpropertynotify(XEvent *e) dockreset(); return; } - if (ev->state == PropertyDelete) - return; obj = getmanaged(ev->window); if (obj == NULL) return;