Skip to content

Commit 0de4197

Browse files
applied Peter Hartlichs nice interim Xinerama and map fix patches, for debugging purposes I also added his transient test driver
1 parent a372248 commit 0de4197

File tree

3 files changed

+56
-5
lines changed

3 files changed

+56
-5
lines changed

LICENSE

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
MIT/X Consortium License
22

33
© 2006-2011 Anselm R Garbe <[email protected]>
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 <[email protected]>
56
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
67
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
78
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
89
© 2007-2009 Christof Musik <christof at sendfax dot de>
10+
© 2009 Mate Nagy <mnagy at port70 dot net>
911
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
10-
© 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
1112
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
1213
© 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>
1415

1516
Permission is hereby granted, free of charge, to any person obtaining a
1617
copy of this software and associated documentation files (the "Software"),

dwm.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ arrange(Monitor *m) {
389389
showhide(m->stack);
390390
else for(m = mons; m; m = m->next)
391391
showhide(m->stack);
392-
focus(NULL);
393392
if(m)
394393
arrangemon(m);
395394
else for(m = mons; m; m = m->next)
@@ -598,6 +597,7 @@ configurenotify(XEvent *e) {
598597
updatebars();
599598
for(m = mons; m; m = m->next)
600599
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
600+
focus(NULL);
601601
arrange(NULL);
602602
}
603603
}
@@ -1154,9 +1154,13 @@ manage(Window w, XWindowAttributes *wa) {
11541154
attach(c);
11551155
attachstack(c);
11561156
XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
1157-
XMapWindow(dpy, c->win);
11581157
setclientstate(c, NormalState);
1158+
if (c->mon == selmon)
1159+
unfocus(selmon->sel, False);
1160+
c->mon->sel = c;
11591161
arrange(c->mon);
1162+
XMapWindow(dpy, c->win);
1163+
focus(NULL);
11601164
}
11611165

11621166
void
@@ -1621,6 +1625,7 @@ void
16211625
tag(const Arg *arg) {
16221626
if(selmon->sel && arg->ui & TAGMASK) {
16231627
selmon->sel->tags = arg->ui & TAGMASK;
1628+
focus(NULL);
16241629
arrange(selmon);
16251630
}
16261631
}
@@ -1701,6 +1706,7 @@ toggletag(const Arg *arg) {
17011706
newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
17021707
if(newtags) {
17031708
selmon->sel->tags = newtags;
1709+
focus(NULL);
17041710
arrange(selmon);
17051711
}
17061712
}
@@ -1711,6 +1717,7 @@ toggleview(const Arg *arg) {
17111717

17121718
if(newtagset) {
17131719
selmon->tagset[selmon->seltags] = newtagset;
1720+
focus(NULL);
17141721
arrange(selmon);
17151722
}
17161723
}
@@ -1976,6 +1983,7 @@ view(const Arg *arg) {
19761983
selmon->seltags ^= 1; /* toggle sel tagset */
19771984
if(arg->ui & TAGMASK)
19781985
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
1986+
focus(NULL);
19791987
arrange(selmon);
19801988
}
19811989

transient.c

+42
Original file line numberDiff line numberDiff line change
@@ -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+
8+
int 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+
}

0 commit comments

Comments
 (0)