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 <psychon@znc.in>
This commit is contained in:
parent
7bf1370502
commit
e830df6092
8
screen.c
8
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue