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 e2e7b70d00, which makes the
system tray not show up for many users when first installing i3.

Thanks to @rtlanceroad for reporting this issue.

fixes #2220
This commit is contained in:
Ingo Bürk 2016-02-21 14:13:58 +01:00
parent 3e1b269409
commit 320591ac19
1 changed files with 4 additions and 13 deletions

View File

@ -769,19 +769,9 @@ static void handle_client_message(xcb_client_message_event_t *event) {
break; break;
} }
/* Check whether any "tray_output primary" was defined for this bar. */ /* If no tray_output has been specified, we fall back to the first
bool contains_primary = false; * available output. */
TAILQ_FOREACH(tray_output, &(config.tray_outputs), tray_outputs) { if (output == NULL && TAILQ_EMPTY(&(config.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)))) {
SLIST_FOREACH(walk, outputs, slist) { SLIST_FOREACH(walk, outputs, slist) {
if (!walk->active) if (!walk->active)
continue; continue;
@ -790,6 +780,7 @@ static void handle_client_message(xcb_client_message_event_t *event) {
break; break;
} }
} }
if (output == NULL) { if (output == NULL) {
ELOG("No output found\n"); ELOG("No output found\n");
return; return;