X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=893d5208003d825ba5ac3986a1405036b755325c;hb=77dc1e0928d50ff6af5d9a386f57c20099629eae;hp=5550805a9fc1c1155ed2895b0d61a107388fd811;hpb=80e56a145d49974eb18223a57cbf38bd8242168d;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 5550805..893d520 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -8177,6 +8177,8 @@ scan_xrandr(int i) xcb_randr_crtc_t *crtc; xcb_screen_t *screen; + DNPRINTF(SWM_D_MISC, "scan_xrandr: screen: %d\n", i); + if ((screen = get_screen(i)) == NULL) errx(1, "ERROR: can't get screen %d.", i); @@ -8204,7 +8206,7 @@ scan_xrandr(int i) new_region(&screens[i], 0, 0, screen->width_in_pixels, screen->height_in_pixels); - return; + goto out; } else ncrtc = srr->num_crtcs; @@ -8230,12 +8232,16 @@ scan_xrandr(int i) free(cir); } free(srr); - } else + } #endif /* SWM_XRR_HAS_CRTC */ - { + + /* If detection failed, create a single region that spans the screen. */ + if (TAILQ_EMPTY(&screens[i].rl)) new_region(&screens[i], 0, 0, screen->width_in_pixels, screen->height_in_pixels); - } + +out: + DNPRINTF(SWM_D_MISC, "scan_xrandr: done.\n"); } void