mirror of
https://git.suckless.org/dwm
synced 2024-12-26 10:56:31 +00:00
applied Peter Hartlichs nice interim Xinerama and map fix patches, for debugging purposes I also added his transient test driver
This commit is contained in:
parent
a372248b80
commit
0de4197cc5
3 changed files with 56 additions and 5 deletions
7
LICENSE
7
LICENSE
|
@ -1,16 +1,17 @@
|
||||||
MIT/X Consortium License
|
MIT/X Consortium License
|
||||||
|
|
||||||
© 2006-2011 Anselm R Garbe <anselm@garbe.us>
|
© 2006-2011 Anselm R Garbe <anselm@garbe.us>
|
||||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
|
||||||
|
© 2010-2011 Connor Lane Smith <cls@lubutu.com>
|
||||||
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
||||||
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
||||||
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
|
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
|
||||||
© 2007-2009 Christof Musik <christof at sendfax dot de>
|
© 2007-2009 Christof Musik <christof at sendfax dot de>
|
||||||
|
© 2009 Mate Nagy <mnagy at port70 dot net>
|
||||||
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
|
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
|
||||||
© 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
|
|
||||||
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
|
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
|
||||||
© 2008 Neale Pickett <neale dot woozle dot org>
|
© 2008 Neale Pickett <neale dot woozle dot org>
|
||||||
© 2009 Mate Nagy <mnagy at port70 dot net>
|
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
12
dwm.c
12
dwm.c
|
@ -389,7 +389,6 @@ arrange(Monitor *m) {
|
||||||
showhide(m->stack);
|
showhide(m->stack);
|
||||||
else for(m = mons; m; m = m->next)
|
else for(m = mons; m; m = m->next)
|
||||||
showhide(m->stack);
|
showhide(m->stack);
|
||||||
focus(NULL);
|
|
||||||
if(m)
|
if(m)
|
||||||
arrangemon(m);
|
arrangemon(m);
|
||||||
else for(m = mons; m; m = m->next)
|
else for(m = mons; m; m = m->next)
|
||||||
|
@ -598,6 +597,7 @@ configurenotify(XEvent *e) {
|
||||||
updatebars();
|
updatebars();
|
||||||
for(m = mons; m; m = m->next)
|
for(m = mons; m; m = m->next)
|
||||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
||||||
|
focus(NULL);
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1154,9 +1154,13 @@ manage(Window w, XWindowAttributes *wa) {
|
||||||
attach(c);
|
attach(c);
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
|
XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
|
||||||
XMapWindow(dpy, c->win);
|
|
||||||
setclientstate(c, NormalState);
|
setclientstate(c, NormalState);
|
||||||
|
if (c->mon == selmon)
|
||||||
|
unfocus(selmon->sel, False);
|
||||||
|
c->mon->sel = c;
|
||||||
arrange(c->mon);
|
arrange(c->mon);
|
||||||
|
XMapWindow(dpy, c->win);
|
||||||
|
focus(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1621,6 +1625,7 @@ void
|
||||||
tag(const Arg *arg) {
|
tag(const Arg *arg) {
|
||||||
if(selmon->sel && arg->ui & TAGMASK) {
|
if(selmon->sel && arg->ui & TAGMASK) {
|
||||||
selmon->sel->tags = arg->ui & TAGMASK;
|
selmon->sel->tags = arg->ui & TAGMASK;
|
||||||
|
focus(NULL);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1701,6 +1706,7 @@ toggletag(const Arg *arg) {
|
||||||
newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
|
newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
|
||||||
if(newtags) {
|
if(newtags) {
|
||||||
selmon->sel->tags = newtags;
|
selmon->sel->tags = newtags;
|
||||||
|
focus(NULL);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1711,6 +1717,7 @@ toggleview(const Arg *arg) {
|
||||||
|
|
||||||
if(newtagset) {
|
if(newtagset) {
|
||||||
selmon->tagset[selmon->seltags] = newtagset;
|
selmon->tagset[selmon->seltags] = newtagset;
|
||||||
|
focus(NULL);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1976,6 +1983,7 @@ view(const Arg *arg) {
|
||||||
selmon->seltags ^= 1; /* toggle sel tagset */
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
if(arg->ui & TAGMASK)
|
if(arg->ui & TAGMASK)
|
||||||
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
||||||
|
focus(NULL);
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
42
transient.c
Normal file
42
transient.c
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/* cc transient.c -o transient -lX11 */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
Display *d;
|
||||||
|
Window r, f, t = None;
|
||||||
|
XSizeHints h;
|
||||||
|
XEvent e;
|
||||||
|
|
||||||
|
d = XOpenDisplay(NULL);
|
||||||
|
if (!d)
|
||||||
|
exit(1);
|
||||||
|
r = DefaultRootWindow(d);
|
||||||
|
|
||||||
|
f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0);
|
||||||
|
h.min_width = h.max_width = h.min_height = h.max_height = 400;
|
||||||
|
h.flags = PMinSize | PMaxSize;
|
||||||
|
XSetWMNormalHints(d, f, &h);
|
||||||
|
XStoreName(d, f, "floating");
|
||||||
|
XMapWindow(d, f);
|
||||||
|
|
||||||
|
XSelectInput(d, f, ExposureMask);
|
||||||
|
while (1) {
|
||||||
|
XNextEvent(d, &e);
|
||||||
|
|
||||||
|
if (t == None) {
|
||||||
|
sleep(5);
|
||||||
|
t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0);
|
||||||
|
XSetTransientForHint(d, t, f);
|
||||||
|
XStoreName(d, t, "transient");
|
||||||
|
XMapWindow(d, t);
|
||||||
|
XSelectInput(d, t, ExposureMask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XCloseDisplay(d);
|
||||||
|
exit(0);
|
||||||
|
}
|
Loading…
Reference in a new issue