From e830df60920496670ab29d5307f3ef5c1dab1d97 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 21 Jul 2010 14:46:49 +0200 Subject: [PATCH] Screen: Only use Xrandr if it provides data This commit makes awesome ignore the screen geometry provided by Xrandr if it only defines a single screen. This should work around nvidia's binary driver which only provides useful data via Xinerama. Signed-off-by: Uli Schlachter --- screen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/screen.c b/screen.c index fcc389819..1e4fc22d7 100644 --- a/screen.c +++ b/screen.c @@ -91,6 +91,14 @@ screen_scan_randr(void) xcb_randr_get_screen_resources_cookie_t screen_res_c = xcb_randr_get_screen_resources(globalconf.connection, screen->root); xcb_randr_get_screen_resources_reply_t *screen_res_r = xcb_randr_get_screen_resources_reply(globalconf.connection, screen_res_c, NULL); + /* Only use the data from XRandR if there is more than one screen + * defined. This should work around the broken nvidia driver. */ + if (screen_res_r->num_crtcs <= 1) + { + p_delete(&screen_res_r); + return false; + } + /* We go through CRTC, and build a screen for each one. */ xcb_randr_crtc_t *randr_crtcs = xcb_randr_get_screen_resources_crtcs(screen_res_r);