X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=a0d33b799640f141224c7eab340b21165d755a24;hb=e218053b3044cbc21b8c2485e0a1584ef344881f;hp=1a4dedbc749d830917f200695950d27c411ab93c;hpb=1e10da5da6a38f589c9d3a83f88724fc72d8bbbc;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 1a4dedb..a0d33b7 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -52,7 +52,7 @@ static const char *cvstag = "$scrotwm$"; -#define SWM_VERSION "0.9.26" +#define SWM_VERSION "0.9.27" #include #include @@ -1040,10 +1040,12 @@ custom_region(char *val) if (x < 0 || x > DisplayWidth(display, sidx) || y < 0 || y > DisplayHeight(display, sidx) || w + x > DisplayWidth(display, sidx) || - h + y > DisplayHeight(display, sidx)) - errx(1, "region %ux%u+%u+%u not within screen boundaries " + h + y > DisplayHeight(display, sidx)) { + fprintf(stderr, "ignoring region %ux%u+%u+%u - not within screen boundaries " "(%ux%u)\n", w, h, x, y, DisplayWidth(display, sidx), DisplayHeight(display, sidx)); + return; + } new_region(&screens[sidx], x, y, w, h); } @@ -2832,6 +2834,9 @@ floating_toggle(struct swm_region *r, union arg *args) struct ws_win *win = r->ws->focus; union arg a; + if (win == NULL) + return; + ewmh_update_win_state(win, ewmh[_NET_WM_STATE_ABOVE].atom, _NET_WM_STATE_TOGGLE); @@ -4439,15 +4444,11 @@ unmanage_window(struct ws_win *win) parent->child_trans = NULL; } - if (count_win(win->ws, 0) > 1) { - /* work around for mplayer going full screen */ - if (!win->floating) - focus_prev(win); - } else - /* the last window is getting nuked, so make sure - the keyboard isn't left without focus */ - XSetInputFocus(display, PointerRoot, - PointerRoot, CurrentTime); + /* focus on root just in case */ + XSetInputFocus(display, PointerRoot, PointerRoot, CurrentTime); + + if (!win->floating) + focus_prev(win); TAILQ_REMOVE(&win->ws->winlist, win, entry); TAILQ_INSERT_TAIL(&win->ws->unmanagedlist, win, entry);