From: Michael Stapelberg Date: Fri, 26 Mar 2010 00:52:08 +0000 (+0100) Subject: randr: Don’t enable outputs with mode 0x0 X-Git-Tag: 3.e~6^2~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7bd4ea3699cb83740998bf4be6bc960d9cfdc909;p=i3%2Fi3 randr: Don’t enable outputs with mode 0x0 Just a sanity check for some possibly broken drivers. --- diff --git a/src/randr.c b/src/randr.c index 42dd8844..d46ffbc4 100644 --- a/src/randr.c +++ b/src/randr.c @@ -339,11 +339,16 @@ static void handle_output(xcb_connection_t *conn, xcb_randr_output_t id, return; } - new->active = true; bool updated = update_if_necessary(&(new->rect.x), crtc->x) | update_if_necessary(&(new->rect.y), crtc->y) | update_if_necessary(&(new->rect.width), crtc->width) | update_if_necessary(&(new->rect.height), crtc->height); + free(crtc); + new->active = (new->rect.width != 0 && new->rect.height != 0); + if (!new->active) { + DLOG("width/height 0/0, disabling output\n"); + return; + } DLOG("mode: %dx%d+%d+%d\n", new->rect.width, new->rect.height, new->rect.x, new->rect.y);