i3bar: Only configure tray on own outputs
If the config specifies a `tray_output` not in the list of outputs over which this bar will span, do not initialize a tray for the bar. Fixes former behavior, which was to initialize the tray without showing the icons, causing disapearing tray icons in multi-monitor environments when `tray_output` isnt `output`.
This commit is contained in:
parent
e99158e419
commit
cce3c8066a
|
@ -1531,10 +1531,20 @@ void reconfig_windows(bool redraw_bars) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tray_configured &&
|
const char *tray_output = (config.tray_output ? config.tray_output : SLIST_FIRST(outputs)->name);
|
||||||
(!config.tray_output ||
|
if (!tray_configured && strcasecmp(tray_output, "none") != 0) {
|
||||||
strcasecmp("none", config.tray_output) != 0)) {
|
/* Configuration sanity check: ensure this i3bar instance handles the output on
|
||||||
|
* which the tray should appear (e.g. don’t initialize a tray if tray_output ==
|
||||||
|
* VGA-1 but output == [HDMI-1]).
|
||||||
|
*/
|
||||||
|
i3_output *output;
|
||||||
|
SLIST_FOREACH(output, outputs, slist) {
|
||||||
|
if (strcasecmp(output->name, tray_output) == 0 ||
|
||||||
|
(strcasecmp(tray_output, "primary") == 0 && output->primary)) {
|
||||||
init_tray();
|
init_tray();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
tray_configured = true;
|
tray_configured = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue