aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-03-09 21:27:16 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-03-10 14:33:31 +0200
commit737180c09f604e6731baca62b3e8c8733a2c29af (patch)
treece7670a799c081f28fe91733b9f8de57a9e46dfc
parentfa5d49be65f943f559729a180d511c0fd18c01a1 (diff)
rework maprequest()
-rw-r--r--monsterwm.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 0c16811..f5d7cef 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -452,25 +452,23 @@ void maprequest(XEvent *e) {
if (ch.res_class) XFree(ch.res_class);
if (ch.res_name) XFree(ch.res_name);
- select_desktop(newdsk);
+ if (cd != newdsk) select_desktop(newdsk);
client *c = addwindow(e->xmaprequest.window);
-
c->istransient = XGetTransientForHint(dis, c->win, &w);
c->isfloating = floating || c->istransient;
int di; unsigned long dl; unsigned char *state = NULL; Atom da;
if (XGetWindowProperty(dis, c->win, netatoms[NET_WM_STATE], 0L, sizeof da,
- False, XA_ATOM, &da, &di, &dl, &dl, &state) == Success && state)
+ False, XA_ATOM, &da, &di, &dl, &dl, &state) == Success && state)
setfullscreen(c, (*(Atom *)state == netatoms[NET_FULLSCREEN]));
if (state) XFree(state);
+ update_current(c);
+ grabbuttons(c);
select_desktop(cd);
- if (cd == newdsk) {
- tile();
- XMapWindow(dis, c->win);
- update_current(c);
- grabbuttons(c);
- } else if (follow) change_desktop(&(Arg){.i = newdsk});
+ if (cd == newdsk) { XMapWindow(dis, c->win); update_current(c); }
+ else if (follow) change_desktop(&(Arg){.i = newdsk});
+
desktopinfo();
}