From 320591ac196df95f6087ad0f8374d68e9f243d1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Sun, 21 Feb 2016 14:13:58 +0100 Subject: [PATCH] Remove unreachable fallback code for tray_output primary. This commit removes the code for falling back to the first available output for the system tray if 'tray_output primary' has been specified but there is no primary output (managed by this bar). This fallback behavior was broken/unreachable because the tray will never be initialized in this situation in the first place. Having this dead code lead to a wrong assumption in #1855 and hence to commit e2e7b70d002cac2031cb65d6f5f197c9583913d6, which makes the system tray not show up for many users when first installing i3. Thanks to @rtlanceroad for reporting this issue. fixes #2220 --- i3bar/src/xcb.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index d2aa28e9..1c2134f4 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -769,19 +769,9 @@ static void handle_client_message(xcb_client_message_event_t *event) { break; } - /* Check whether any "tray_output primary" was defined for this bar. */ - bool contains_primary = false; - TAILQ_FOREACH(tray_output, &(config.tray_outputs), tray_outputs) { - if (strcasecmp("primary", tray_output->output) == 0) { - contains_primary = true; - break; - } - } - - /* In case of tray_output == primary and there is no primary output - * configured, we fall back to the first available output. We do the - * same if no tray_output was specified. */ - if (output == NULL && (contains_primary || TAILQ_EMPTY(&(config.tray_outputs)))) { + /* If no tray_output has been specified, we fall back to the first + * available output. */ + if (output == NULL && TAILQ_EMPTY(&(config.tray_outputs))) { SLIST_FOREACH(walk, outputs, slist) { if (!walk->active) continue; @@ -790,6 +780,7 @@ static void handle_client_message(xcb_client_message_event_t *event) { break; } } + if (output == NULL) { ELOG("No output found\n"); return; -- 2.39.2