From a81108c5273590ecd2b78ec1114b75aa8358c014 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 5 Sep 2009 19:17:59 +0200 Subject: [PATCH] Bugfix: Initialize screens correctly when not using Xinerama (Thanks Mikael) --- src/xinerama.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/xinerama.c b/src/xinerama.c index 59e7e225..f40ec84b 100644 --- a/src/xinerama.c +++ b/src/xinerama.c @@ -246,19 +246,18 @@ void initialize_xinerama(xcb_connection_t *conn) { if (!xcb_get_extension_data(conn, &xcb_xinerama_id)->present) { LOG("Xinerama extension not found, disabling.\n"); disable_xinerama(conn); - return; - } + } else { + xcb_xinerama_is_active_reply_t *reply; + reply = xcb_xinerama_is_active_reply(conn, xcb_xinerama_is_active(conn), NULL); - xcb_xinerama_is_active_reply_t *reply; - reply = xcb_xinerama_is_active_reply(conn, xcb_xinerama_is_active(conn), NULL); + if (reply == NULL || !reply->state) { + LOG("Xinerama is not active (in your X-Server), disabling.\n"); + disable_xinerama(conn); + } else + query_screens(conn, virtual_screens); - if (reply == NULL || !reply->state) { - LOG("Xinerama is not active (in your X-Server), disabling.\n"); - disable_xinerama(conn); - } else - query_screens(conn, virtual_screens); - - FREE(reply); + FREE(reply); + } i3Screen *screen; num_screens = 0; -- 2.39.5