From: Ryan McBride Date: Fri, 12 Nov 2010 01:35:01 +0000 (+0000) Subject: Instead of dying when a manually defined region is outside of screen X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=98026635c53e85dbe05fab0c1c8460a4ddd1b51d;p=spectrwm.git Instead of dying when a manually defined region is outside of screen boundaries, just ignore the region. Lets you at least log in and run xrandr to fix the screen, then M-q to apply the manual region. --- diff --git a/scrotwm.c b/scrotwm.c index eb917a4..33de7c2 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -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); }