X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sys-x11.c;h=e60b97c7e94f4f47e1ef2a5e8f9751d74b9075ce;hb=6f9eafa3b63b7b95af52187bc550d0d4527c1f23;hp=dbf1211bcdee8d72d1c8c8d8770c23ac7a737c31;hpb=5dd54ab27b27c888741e5700aad89226009eb449;p=wmpus diff --git a/sys-x11.c b/sys-x11.c index dbf1211..e60b97c 100644 --- a/sys-x11.c +++ b/sys-x11.c @@ -230,10 +230,10 @@ static void process_event(int type, XEvent *ev, win_t *root) wm_handle_key(win, key, MOD(), PTR()); } else if (type == ConfigureNotify) { - //printf("configure: %d\n", type); + printf("configure: %d\n", type); } else if (type == MapNotify) { - //printf("map: %d\n", type); + printf("map: %d\n", type); } else if (type == UnmapNotify) { //printf("unmap: %d\n", type); @@ -264,11 +264,6 @@ static void process_event(int type, XEvent *ev, win_t *root) } } -static int xwmerror(Display *dpy, XErrorEvent *err) -{ - return error("another window manager is running?"); -} - static int xerror(Display *dpy, XErrorEvent *err) { if (err->error_code == BadWindow || @@ -290,9 +285,10 @@ static int xerror(Display *dpy, XErrorEvent *err) void sys_move(win_t *win, int x, int y, int w, int h) { //printf("sys_move: %p - %d,%d %dx%d\n", win, x, y, w, h); - win->x = x; win->y = y; - win->w = w; win->h = h; - XMoveResizeWindow(win->sys->dpy, win->sys->xid, x, y, w, h); + win->x = MAX(x,0); win->y = MAX(y,0); + win->w = MAX(w,1); win->h = MAX(h,1); + XMoveResizeWindow(win->sys->dpy, win->sys->xid, + win->x, win->y, win->w, win->h); /* Flush events, so moving window doesn't cuase re-focus * There's probably a better way to do this */