ObEdge ***edge;
#warning put in config.c and parse configs of course
gboolean config_edge_enabled[OB_NUM_EDGES] = {1, 1, 1, 1, 1, 1, 1, 1};
+/* this could change at runtime, we should hook into that, but for now
+ * don't crash on reconfigure/shutdown */
+static edge_monitors;
#ifdef DEBUG
#define EDGE_WIDTH 10
xswa.override_redirect = True;
- edge = g_slice_alloc(sizeof(ObEdge**) * screen_num_monitors);
- for (m = 0; m < screen_num_monitors; m++) {
+ edge_monitors = screen_num_monitors;
+
+ edge = g_slice_alloc(sizeof(ObEdge**) * edge_monitors);
+ for (m = 0; m < edge_monitors; m++) {
const Rect *monitor = screen_physical_area_monitor(m);
edge[m] = g_slice_alloc(sizeof(ObEdge*) * OB_NUM_EDGES);
for (i=0; i < OB_NUM_EDGES; i++) {
{
gint i, m;
- for (m = 0; m < screen_num_monitors; m++) {
+ for (m = 0; m < edge_monitors; m++) {
for (i = 0; i < OB_NUM_EDGES; i++) {
+ if (!config_edge_enabled[i])
+ continue;
+
window_remove(edge[m][i]->win);
stacking_remove(EDGE_AS_WINDOW(edge[m][i]));
XDestroyWindow(obt_display, edge[m][i]->win);
}
g_slice_free1(sizeof(ObEdge*) * OB_NUM_EDGES, edge[m]);
}
- g_slice_free1(sizeof(ObEdge**) * screen_num_monitors, edge);
+ g_slice_free1(sizeof(ObEdge**) * edge_monitors, edge);
}