[PATCH 2/4] kdrive: always advance kdOrigin if a screen size was specified

Keith Packard keithp at keithp.com
Wed Nov 13 18:35:44 PST 2013


Peter Hutterer <peter.hutterer at who-t.net> writes:

> If a screen size was specified as WxH, the loop returned early and kdOrigin
> was never advanced. Thus, screen->origin was always 0 (or whatever was given
> at the -origin commandline flag).
>
> If a screen size was given with a bit depth (WxH at D), kdOrigin would always
> advance by the current screen, offsetting the next screen.

I think the problem here was just the early loop termination clause
which wasn't accepting WxH as a valid geometry spec. I think this is
what we want instead:

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index f8949be..3829684 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -328,7 +328,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
             screen->height = pixels;
             screen->height_mm = mm;
         }
-        if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y')
+        if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y' &&
+            (delim != '\0' || i == 0))
             return;
     }
 

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131114/f4abd480/attachment.pgp>


More information about the xorg-devel mailing list