}
if (!strcmp(cur_key, "tray_output")) {
- printf("tray_output %.*s\n", len, val);
- /* XXX: these are not implemented yet */
+ DLOG("tray_output %.*s\n", len, val);
+ FREE(config.tray_output);
+ asprintf(&config.tray_output, "%.*s", len, val);
return 1;
}
SLIST_FOREACH(walk, outputs, slist) {
if (!walk->active)
continue;
+ if (config.tray_output &&
+ strcasecmp(walk->name, config.tray_output) != 0)
+ continue;
DLOG("using output %s\n", walk->name);
output = walk;
}
*
*/
void init_tray() {
+ DLOG("Initializing system tray functionality\n");
/* request the tray manager atom for the X11 display we are running on */
char atomname[strlen("_NET_SYSTEM_TRAY_S") + 11];
snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S%d", screen);
void reconfig_windows() {
uint32_t mask;
uint32_t values[5];
+ static bool tray_configured = false;
i3_output *walk;
SLIST_FOREACH(walk, outputs, slist) {
if (walk->bar == XCB_NONE) {
DLOG("Creating Window for output %s\n", walk->name);
- /* TODO: only call init_tray() if the tray is configured for this output */
- init_tray();
-
walk->bar = xcb_generate_id(xcb_connection);
walk->buffer = xcb_generate_id(xcb_connection);
mask = XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK;
(!config.hide_on_modifier && xcb_request_failed(map_cookie, "Could not map window"))) {
exit(EXIT_FAILURE);
}
+
+ if (!tray_configured &&
+ strcasecmp("none", config.tray_output) != 0) {
+ init_tray();
+ tray_configured = true;
+ }
} else {
/* We already have a bar, so we just reconfigure it */
mask = XCB_CONFIG_WINDOW_X |