X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sys-x11.c;h=db711c94a3561e8d7bb6f9669b697939b5bf3fda;hb=354101b66a115a36599d856fc7f3b4b350c080e4;hp=dbf1211bcdee8d72d1c8c8d8770c23ac7a737c31;hpb=5dd54ab27b27c888741e5700aad89226009eb449;p=wmpus diff --git a/sys-x11.c b/sys-x11.c index dbf1211..db711c9 100644 --- a/sys-x11.c +++ b/sys-x11.c @@ -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 */