X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sys-x11.c;h=6bc3b019246ef6ceb55768b6bbb12133d9291ab8;hb=6e8fb5fe1c8a0a75b698fc25bb8c54bc105179ee;hp=adb4eae71d8270c5de1883749b8fbeaac11fab60;hpb=a3a2c5e71711482dfce333a6a8b5724f3c5f84bf;p=wmpus diff --git a/sys-x11.c b/sys-x11.c index adb4eae..6bc3b01 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); @@ -356,7 +356,7 @@ static void process_event(int type, XEvent *xe, win_t *root) /* Split based on event */ if (type == KeyPress) { while (XCheckTypedEvent(dpy, KeyPress, xe)); - KeySym sym = XKeycodeToKeysym(dpy, xe->xkey.keycode, 0); + KeySym sym = XLookupKeysym(&xe->xkey, 0); printf("got xe %c %hhx\n", xk2ev(sym), mod2int(mod)); wm_handle_event(win, xk2ev(sym), mod, ptr); } @@ -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;