Introduction
Introduction Statistics Contact Development Disclaimer Help
tfixed misappearance of iconified windows on SIGKILL - dwm - [fork] customized …
git clone git://src.adamsgaard.dk/dwm
Log
Files
Refs
README
LICENSE
---
commit fc109ea8f72e662ed58ef45329b6ca9e91d61d3b
parent b975c4728046052a32626378df193217a96fbefc
Author: Anselm R. Garbe <[email protected]>
Date: Sun, 19 Aug 2007 18:39:54 +0200
fixed misappearance of iconified windows on SIGKILL
Diffstat:
M main.c | 27 ++++++++++++++++++++++++++-
M screen.c | 6 +++---
2 files changed, 29 insertions(+), 4 deletions(-)
---
diff --git a/main.c b/main.c
t@@ -111,6 +111,24 @@ initfont(const char *fontstr) {
dc.font.height = dc.font.ascent + dc.font.descent;
}
+static long
+getstate(Window w) {
+ int format, status;
+ long result = -1;
+ unsigned char *p = NULL;
+ unsigned long n, extra;
+ Atom real;
+
+ status = XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wm…
+ &real, &format, &n, &extra, (unsigned char **)&p);
+ if(status != Success)
+ return -1;
+ if(n != 0)
+ result = *p;
+ XFree(p);
+ return result;
+}
+
static void
scan(void) {
unsigned int i, num;
t@@ -123,7 +141,14 @@ scan(void) {
if(!XGetWindowAttributes(dpy, wins[i], &wa)
|| wa.override_redirect || XGetTransientForHint(dpy, w…
continue;
- if(wa.map_state == IsViewable)
+ if(wa.map_state == IsViewable || getstate(wins[i]) == …
+ manage(wins[i], &wa);
+ }
+ for(i = 0; i < num; i++) { /* now the transients */
+ if(!XGetWindowAttributes(dpy, wins[i], &wa))
+ continue;
+ if(XGetTransientForHint(dpy, wins[i], &d1)
+ && (wa.map_state == IsViewable || getstate(wins[i]) ==…
manage(wins[i], &wa);
}
}
diff --git a/screen.c b/screen.c
t@@ -60,7 +60,7 @@ setdwmprops(void) {
for(i = 0; i < ntags && i < sizeof prop - 1; i++)
prop[i] = seltags[i] ? '1' : '0';
if(i < sizeof prop - 1)
- prop[i++] = (char)ltidx;
+ prop[i++] = (char)ltidx + '0';
prop[i] = '\0';
XChangeProperty(dpy, root, dwmprops, XA_STRING, 8,
PropModeReplace, (unsigned char *)prop, i);
t@@ -223,8 +223,8 @@ getdwmprops(void) {
for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'…
seltags[i] = prop[i] == '1';
if(i < sizeof prop - 1 && prop[i] != '\0') {
- if(prop[i] < nlayouts)
- ltidx = prop[i];
+ if((unsigned int)(prop[i] - '0') < nlayouts)
+ ltidx = prop[i] - '0';
}
}
}
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.