mharris 3a3aa5
Patch by krh@redhat.com:
mharris 3a3aa5
mharris 3a3aa5
      In a multihead setup, if only the first screen can be
mharris 3a3aa5
      initialized, but the second screen is mentioned first in the
mharris 3a3aa5
      ServerLayout section, the xf86InitOrigins() function will crash
mharris 3a3aa5
      because the screen referred to in the e.g. "RightOf" part is
mharris 3a3aa5
      non-existent.
mharris 3a3aa5
mharris 3a3aa5
--- hw/xfree86/common/xf86Cursor.c.init-origins-fix	2004-10-18 22:22:42.675899006 -0400
mharris 3a3aa5
+++ hw/xfree86/common/xf86Cursor.c	2004-10-18 22:21:42.540867549 -0400
mharris 3a3aa5
@@ -566,6 +566,14 @@
mharris 3a3aa5
 
mharris 3a3aa5
 	    screen = &xf86ConfigLayout.screens[i];
mharris 3a3aa5
 
mharris 3a3aa5
+	    if (screen->refscreen != NULL &&
mharris 3a3aa5
+		screen->refscreen->screennum >= xf86NumScreens) {
mharris 3a3aa5
+		screensLeft &= ~(1 << i);
mharris 3a3aa5
+	        xf86Msg(X_WARNING, "Not including screen \"%s\" in origins calculation.\n",
mharris 3a3aa5
+			screen->screen->id);
mharris 3a3aa5
+	        continue;
mharris 3a3aa5
+	    }	      
mharris 3a3aa5
+
mharris 3a3aa5
 	    switch(screen->where) {
mharris 3a3aa5
 	    case PosObsolete:
mharris 3a3aa5
 		OldStyleConfig = TRUE;