Correctly disable RandR if it provides no usable data (#1012)

Fixes: https://github.com/awesomeWM/awesome/issues/1003
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-07-31 16:52:44 +02:00 committed by Daniel Hahler
parent f20053bb33
commit 128933c115
1 changed files with 11 additions and 1 deletions

View File

@ -445,6 +445,16 @@ screen_scan_randr(lua_State *L, screen_array_t *screens)
screen_scan_randr_monitors(L, screens);
else
screen_scan_randr_crtcs(L, screens);
if (screens->len == 0)
{
/* Scanning failed, disable randr again */
xcb_randr_select_input(globalconf.connection,
globalconf.screen->root,
0);
globalconf.have_randr_13 = false;
globalconf.have_randr_15 = false;
}
}
static void
@ -588,7 +598,7 @@ screen_modified(screen_t *existing_screen, screen_t *other_screen)
void
screen_refresh(void)
{
if(!globalconf.screen_need_refresh)
if(!globalconf.screen_need_refresh || !globalconf.have_randr_13)
return;
globalconf.screen_need_refresh = false;