summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgarbeam@gmail.com <unknown>2011-07-29 20:01:22 +0200
committergarbeam@gmail.com <unknown>2011-07-29 20:01:22 +0200
commit0de4197cc5e8e81d94d0faffbaf46abab4d44d1a (patch)
treee28bf0daec67f4fbd455c9af15a0b1738c916c1a
parentapplied anonymous code cleanup patch (diff)
downloaddwm-0de4197cc5e8e81d94d0faffbaf46abab4d44d1a.tar.gz
dwm-0de4197cc5e8e81d94d0faffbaf46abab4d44d1a.zip
applied Peter Hartlichs nice interim Xinerama and map fix patches, for debugging purposes I also added his transient test driver
-rw-r--r--LICENSE7
-rw-r--r--dwm.c12
-rw-r--r--transient.c42
3 files changed, 56 insertions, 5 deletions
diff --git a/LICENSE b/LICENSE
index ed4e415..e8e793a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,16 +1,17 @@
1MIT/X Consortium License 1MIT/X Consortium License
2 2
3© 2006-2011 Anselm R Garbe <anselm@garbe.us> 3© 2006-2011 Anselm R Garbe <anselm@garbe.us>
4© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com> 4© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
5© 2010-2011 Connor Lane Smith <cls@lubutu.com>
5© 2006-2009 Jukka Salmi <jukka at salmi dot ch> 6© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
6© 2007-2009 Premysl Hruby <dfenze at gmail dot com> 7© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
7© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com> 8© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
8© 2007-2009 Christof Musik <christof at sendfax dot de> 9© 2007-2009 Christof Musik <christof at sendfax dot de>
10© 2009 Mate Nagy <mnagy at port70 dot net>
9© 2007-2008 Enno Gottox Boland <gottox at s01 dot de> 11© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
10© 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
11© 2008 Martin Hurton <martin dot hurton at gmail dot com> 12© 2008 Martin Hurton <martin dot hurton at gmail dot com>
12© 2008 Neale Pickett <neale dot woozle dot org> 13© 2008 Neale Pickett <neale dot woozle dot org>
13© 2009 Mate Nagy <mnagy at port70 dot net> 14© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
14 15
15Permission is hereby granted, free of charge, to any person obtaining a 16Permission is hereby granted, free of charge, to any person obtaining a
16copy of this software and associated documentation files (the "Software"), 17copy of this software and associated documentation files (the "Software"),
diff --git a/dwm.c b/dwm.c
index 402b2b9..db0fdfb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -389,7 +389,6 @@ arrange(Monitor *m) {
389 showhide(m->stack); 389 showhide(m->stack);
390 else for(m = mons; m; m = m->next) 390 else for(m = mons; m; m = m->next)
391 showhide(m->stack); 391 showhide(m->stack);
392 focus(NULL);
393 if(m) 392 if(m)
394 arrangemon(m); 393 arrangemon(m);
395 else for(m = mons; m; m = m->next) 394 else for(m = mons; m; m = m->next)
@@ -598,6 +597,7 @@ configurenotify(XEvent *e) {
598 updatebars(); 597 updatebars();
599 for(m = mons; m; m = m->next) 598 for(m = mons; m; m = m->next)
600 XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); 599 XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
600 focus(NULL);
601 arrange(NULL); 601 arrange(NULL);
602 } 602 }
603 } 603 }
@@ -1154,9 +1154,13 @@ manage(Window w, XWindowAttributes *wa) {
1154 attach(c); 1154 attach(c);
1155 attachstack(c); 1155 attachstack(c);
1156 XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 1156 XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
1157 XMapWindow(dpy, c->win);
1158 setclientstate(c, NormalState); 1157 setclientstate(c, NormalState);
1158 if (c->mon == selmon)
1159 unfocus(selmon->sel, False);
1160 c->mon->sel = c;
1159 arrange(c->mon); 1161 arrange(c->mon);
1162 XMapWindow(dpy, c->win);
1163 focus(NULL);
1160} 1164}
1161 1165
1162void 1166void
@@ -1621,6 +1625,7 @@ void
1621tag(const Arg *arg) { 1625tag(const Arg *arg) {
1622 if(selmon->sel && arg->ui & TAGMASK) { 1626 if(selmon->sel && arg->ui & TAGMASK) {
1623 selmon->sel->tags = arg->ui & TAGMASK; 1627 selmon->sel->tags = arg->ui & TAGMASK;
1628 focus(NULL);
1624 arrange(selmon); 1629 arrange(selmon);
1625 } 1630 }
1626} 1631}
@@ -1701,6 +1706,7 @@ toggletag(const Arg *arg) {
1701 newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); 1706 newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
1702 if(newtags) { 1707 if(newtags) {
1703 selmon->sel->tags = newtags; 1708 selmon->sel->tags = newtags;
1709 focus(NULL);
1704 arrange(selmon); 1710 arrange(selmon);
1705 } 1711 }
1706} 1712}
@@ -1711,6 +1717,7 @@ toggleview(const Arg *arg) {
1711 1717
1712 if(newtagset) { 1718 if(newtagset) {
1713 selmon->tagset[selmon->seltags] = newtagset; 1719 selmon->tagset[selmon->seltags] = newtagset;
1720 focus(NULL);
1714 arrange(selmon); 1721 arrange(selmon);
1715 } 1722 }
1716} 1723}
@@ -1976,6 +1983,7 @@ view(const Arg *arg) {
1976 selmon->seltags ^= 1; /* toggle sel tagset */ 1983 selmon->seltags ^= 1; /* toggle sel tagset */
1977 if(arg->ui & TAGMASK) 1984 if(arg->ui & TAGMASK)
1978 selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; 1985 selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
1986 focus(NULL);
1979 arrange(selmon); 1987 arrange(selmon);
1980} 1988}
1981 1989
diff --git a/transient.c b/transient.c
new file mode 100644
index 0000000..040adb5
--- /dev/null
+++ b/transient.c
@@ -0,0 +1,42 @@
1/* cc transient.c -o transient -lX11 */
2
3#include <stdlib.h>
4#include <unistd.h>
5#include <X11/Xlib.h>
6#include <X11/Xutil.h>
7
8int main(void) {
9 Display *d;
10 Window r, f, t = None;
11 XSizeHints h;
12 XEvent e;
13
14 d = XOpenDisplay(NULL);
15 if (!d)
16 exit(1);
17 r = DefaultRootWindow(d);
18
19 f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
20 h.min_width = h.max_width = h.min_height = h.max_height = 400;
21 h.flags = PMinSize | PMaxSize;
22 XSetWMNormalHints(d, f, &h);
23 XStoreName(d, f, "floating");
24 XMapWindow(d, f);
25
26 XSelectInput(d, f, ExposureMask);
27 while (1) {
28 XNextEvent(d, &e);
29
30 if (t == None) {
31 sleep(5);
32 t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
33 XSetTransientForHint(d, t, f);
34 XStoreName(d, t, "transient");
35 XMapWindow(d, t);
36 XSelectInput(d, t, ExposureMask);
37 }
38 }
39
40 XCloseDisplay(d);
41 exit(0);
42}