Merge pull request #2017 from Airblader/bug-2011

Activate root output if RandR request fails.
This commit is contained in:
Michael Stapelberg 2015-10-22 09:19:07 +02:00
commit 0425f48835
1 changed files with 19 additions and 17 deletions

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()) {