From 8825d36a38c76ff8faf409c853061be2bd33430d Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Tue, 9 Oct 2007 22:49:07 -0400 Subject: [PATCH] Allow the user to not have a screen section If none is present, a default one will be created. This will be attached to either the first device section in the xorg.conf (allowing you to specify something like using EXA without having a screen section) or a default screen section if none is present in the file. --- hw/xfree86/common/xf86Config.c | 11 ++++++----- hw/xfree86/parser/read.c | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 9629df5cc..9c54bf473 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1813,11 +1813,6 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen) if (!servlayoutp) return FALSE; - if (conf_screen == NULL) { - xf86ConfigError("No Screen sections present\n"); - return FALSE; - } - /* * which screen section is the active one? * @@ -1905,6 +1900,12 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, XF86ConfAdaptorLinkPtr conf_adaptor; Bool defaultMonitor = FALSE; + if (!conf_screen) { + conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec)); + conf_screen->scrn_identifier = "Default Screen Section"; + xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n"); + } + xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier, scrnum); /* diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c index 308ee0304..a272f5ce3 100644 --- a/hw/xfree86/parser/read.c +++ b/hw/xfree86/parser/read.c @@ -82,8 +82,8 @@ xf86validateConfig (XF86ConfigPtr p) { /*if (!xf86validateDevice (p)) return FALSE;*/ - if (!xf86validateScreen (p)) - return FALSE; + /*if (!xf86validateScreen (p)) + return FALSE;*/ if (!xf86validateInput (p)) return FALSE; if (!xf86validateLayout (p))