JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Instead of dying when a manually defined region is outside of screen
authorRyan McBride <mcbride@countersiege.com>
Fri, 12 Nov 2010 01:35:01 +0000 (01:35 +0000)
committerRyan McBride <mcbride@countersiege.com>
Fri, 12 Nov 2010 01:35:01 +0000 (01:35 +0000)
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.

scrotwm.c

index eb917a4..33de7c2 100644 (file)
--- 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);
 }