X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sys-x11.c;h=24decf6182c6572047de71596c27b3cf7b36de9b;hb=7ae4e2aca3b27fbd825a35f721b8456f0434621a;hp=adb4eae71d8270c5de1883749b8fbeaac11fab60;hpb=a3a2c5e71711482dfce333a6a8b5724f3c5f84bf;p=wmpus diff --git a/sys-x11.c b/sys-x11.c index adb4eae..24decf6 100644 --- a/sys-x11.c +++ b/sys-x11.c @@ -189,10 +189,10 @@ static int strut_add(win_t *root, win_t *win) if (status != Success || ret_size != 32 || ret_items != 4) return 0; - win->sys->strut.left = ((int*)xdata)[0]; - win->sys->strut.right = ((int*)xdata)[1]; - win->sys->strut.top = ((int*)xdata)[2]; - win->sys->strut.bottom = ((int*)xdata)[3]; + win->sys->strut.left = ((long*)xdata)[0]; + win->sys->strut.right = ((long*)xdata)[1]; + win->sys->strut.top = ((long*)xdata)[2]; + win->sys->strut.bottom = ((long*)xdata)[3]; struts = list_insert(struts, win); for (list_t *cur = screens; cur; cur = cur->next) strut_copy(cur->data, win, 1); @@ -438,6 +438,7 @@ static void process_event(int type, XEvent *xe, win_t *root) printf("map_req: %d\n", type); if ((win = win_find(dpy,xe->xmaprequest.window,1)) && win->state == ST_HIDE) { + win->state = ST_SHOW; if (win_prop(win, NET_STATE) == atoms[NET_FULL]) win->state = ST_FULL; XSelectInput(win->sys->dpy, win->sys->xid, PropertyChangeMask); @@ -445,8 +446,8 @@ static void process_event(int type, XEvent *xe, win_t *root) wm_insert(win); else wm_update(); - } else - sys_show(win, ST_SHOW); + } + sys_show(win, win->state); } else if (type == ClientMessage) { XClientMessageEvent *cme = &xe->xclient;