applied Peter Hartlichs nice interim Xinerama and map fix patches, for debugging purposes I also added his transient test driver
0de4197c
3 file(s) · +56 −5
| 1 | 1 | MIT/X Consortium License |
|
| 2 | 2 | ||
| 3 | 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 | 6 | © 2006-2009 Jukka Salmi <jukka at salmi dot ch> |
|
| 6 | 7 | © 2007-2009 Premysl Hruby <dfenze at gmail dot com> |
|
| 7 | 8 | © 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com> |
|
| 8 | 9 | © 2007-2009 Christof Musik <christof at sendfax dot de> |
|
| 10 | + | © 2009 Mate Nagy <mnagy at port70 dot net> |
|
| 9 | 11 | © 2007-2008 Enno Gottox Boland <gottox at s01 dot de> |
|
| 10 | - | © 2007-2008 Peter Hartlich <sgkkr at hartlich dot com> |
|
| 11 | 12 | © 2008 Martin Hurton <martin dot hurton at gmail dot com> |
|
| 12 | 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 | ||
| 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining a |
|
| 16 | 17 | copy of this software and associated documentation files (the "Software"), |
| 389 | 389 | showhide(m->stack); |
|
| 390 | 390 | else for(m = mons; m; m = m->next) |
|
| 391 | 391 | showhide(m->stack); |
|
| 392 | - | focus(NULL); |
|
| 393 | 392 | if(m) |
|
| 394 | 393 | arrangemon(m); |
|
| 395 | 394 | else for(m = mons; m; m = m->next) |
|
| 598 | 597 | updatebars(); |
|
| 599 | 598 | for(m = mons; m; m = m->next) |
|
| 600 | 599 | XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); |
|
| 600 | + | focus(NULL); |
|
| 601 | 601 | arrange(NULL); |
|
| 602 | 602 | } |
|
| 603 | 603 | } |
|
| 1154 | 1154 | attach(c); |
|
| 1155 | 1155 | attachstack(c); |
|
| 1156 | 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 | 1157 | setclientstate(c, NormalState); |
|
| 1158 | + | if (c->mon == selmon) |
|
| 1159 | + | unfocus(selmon->sel, False); |
|
| 1160 | + | c->mon->sel = c; |
|
| 1159 | 1161 | arrange(c->mon); |
|
| 1162 | + | XMapWindow(dpy, c->win); |
|
| 1163 | + | focus(NULL); |
|
| 1160 | 1164 | } |
|
| 1161 | 1165 | ||
| 1162 | 1166 | void |
|
| 1621 | 1625 | tag(const Arg *arg) { |
|
| 1622 | 1626 | if(selmon->sel && arg->ui & TAGMASK) { |
|
| 1623 | 1627 | selmon->sel->tags = arg->ui & TAGMASK; |
|
| 1628 | + | focus(NULL); |
|
| 1624 | 1629 | arrange(selmon); |
|
| 1625 | 1630 | } |
|
| 1626 | 1631 | } |
|
| 1701 | 1706 | newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); |
|
| 1702 | 1707 | if(newtags) { |
|
| 1703 | 1708 | selmon->sel->tags = newtags; |
|
| 1709 | + | focus(NULL); |
|
| 1704 | 1710 | arrange(selmon); |
|
| 1705 | 1711 | } |
|
| 1706 | 1712 | } |
|
| 1711 | 1717 | ||
| 1712 | 1718 | if(newtagset) { |
|
| 1713 | 1719 | selmon->tagset[selmon->seltags] = newtagset; |
|
| 1720 | + | focus(NULL); |
|
| 1714 | 1721 | arrange(selmon); |
|
| 1715 | 1722 | } |
|
| 1716 | 1723 | } |
|
| 1976 | 1983 | selmon->seltags ^= 1; /* toggle sel tagset */ |
|
| 1977 | 1984 | if(arg->ui & TAGMASK) |
|
| 1978 | 1985 | selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; |
|
| 1986 | + | focus(NULL); |
|
| 1979 | 1987 | arrange(selmon); |
|
| 1980 | 1988 | } |
|
| 1981 | 1989 | ||
| 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 | + | } |