Activate root output if RandR request fails.

fixes #2011
This commit is contained in:
Ingo Bürk 2015-10-19 21:17:35 +02:00 committed by Michael Stapelberg
parent 76db8b73ae
commit 7c75d61a39

View File

@ -604,7 +604,6 @@ void randr_query_outputs(void) {
Output *output, *other, *first;
xcb_randr_get_output_primary_cookie_t pcookie;
xcb_randr_get_screen_resources_current_cookie_t rcookie;
resources_reply *res;
/* timestamp of the configuration so that we get consistent replies to all
* requests (if the configuration changes between our different calls) */
@ -621,9 +620,11 @@ void randr_query_outputs(void) {
ELOG("Could not get RandR primary output\n");
else
DLOG("primary output is %08x\n", primary->output);
if ((res = xcb_randr_get_screen_resources_current_reply(conn, rcookie, NULL)) == NULL)
return;
resources_reply *res = xcb_randr_get_screen_resources_current_reply(conn, rcookie, NULL);
if (res == NULL) {
ELOG("Could not query screen resources.\n");
} else {
cts = res->config_timestamp;
int len = xcb_randr_get_screen_resources_current_outputs_length(res);
@ -644,6 +645,7 @@ void randr_query_outputs(void) {
handle_output(conn, randr_outputs[i], output, cts, res);
free(output);
}
}
/* If there's no randr output, enable the output covering the root window. */
if (any_randr_output_active()) {