*/
void get_atoms();
+/*
+ * Reparents all tray clients of the specified output to the root window. This
+ * is either used when shutting down, when an output appears (xrandr --output
+ * VGA1 --off) or when the primary output changes.
+ *
+ * Applications using the tray will start the protocol from the beginning again
+ * afterwards.
+ *
+ */
+void kick_tray_clients(i3_output *output);
+
/*
* Destroy the bar of the specified output
*
DLOG("Reconfiguring Windows...\n");
realloc_sl_buffer();
reconfig_windows();
+
+ i3_output *o_walk;
+ SLIST_FOREACH(o_walk, outputs, slist) {
+ kick_tray_clients(o_walk);
+ }
}
/*
}
/*
- * Destroy the bar of the specified output
+ * Reparents all tray clients of the specified output to the root window. This
+ * is either used when shutting down, when an output appears (xrandr --output
+ * VGA1 --off) or when the primary output changes.
+ *
+ * Applications using the tray will start the protocol from the beginning again
+ * afterwards.
*
*/
-void destroy_window(i3_output *output) {
- if (output == NULL) {
- return;
- }
- if (output->bar == XCB_NONE) {
- return;
- }
-
+void kick_tray_clients(i3_output *output) {
trayclient *trayclient;
TAILQ_FOREACH(trayclient, output->trayclients, tailq) {
/* Unmap, then reparent (to root) the tray client windows */
0,
0);
}
+}
+
+/*
+ * Destroy the bar of the specified output
+ *
+ */
+void destroy_window(i3_output *output) {
+ if (output == NULL) {
+ return;
+ }
+ if (output->bar == XCB_NONE) {
+ return;
+ }
+ kick_tray_clients(output);
xcb_destroy_window(xcb_connection, output->bar);
output->bar = XCB_NONE;
}