]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: when tray_output == primary and there is no primary output, fall back to the...
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 22 Apr 2012 18:51:15 +0000 (20:51 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 22 Apr 2012 18:51:15 +0000 (20:51 +0200)
i3bar/src/xcb.c

index 9907665e7ff0d6ae18ffd732c11747629f49baba..67572480510ba5075f0d300f0b364e3701f25787 100644 (file)
@@ -458,6 +458,18 @@ static void handle_client_message(xcb_client_message_event_t* event) {
 
                 DLOG("using output %s\n", walk->name);
                 output = walk;
+                break;
+            }
+            /* In case of tray_output == primary and there is no primary output
+             * configured, we fall back to the first available output. */
+            if (output == NULL && strcasecmp("primary", config.tray_output) == 0) {
+                SLIST_FOREACH(walk, outputs, slist) {
+                    if (!walk->active)
+                        continue;
+                    DLOG("Falling back to output %s because no primary output is configured\n", walk->name);
+                    output = walk;
+                    break;
+                }
             }
             if (output == NULL) {
                 ELOG("No output found\n");