From c65dfa5c34e81bb3556030e2ca65163f2a8426a9 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 18 Apr 2013 13:08:11 +0200 Subject: [PATCH] Reinit edges stuff on screen resize --- openbox/edges.c | 14 ++++++++++++-- openbox/edges.h | 1 + openbox/screen.c | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/openbox/edges.c b/openbox/edges.c index 1576dbaf..2b40619b 100644 --- a/openbox/edges.c +++ b/openbox/edges.c @@ -8,12 +8,12 @@ #include /* Array of array of monitors of edges: edge[monitor 2][top edge] */ -ObEdge ***edge; +ObEdge ***edge = NULL; #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; +static guint edge_monitors; #ifdef DEBUG #define EDGE_WIDTH 10 @@ -109,6 +109,10 @@ void edges_shutdown(gboolean reconfigure) { gint i, m; + /* This is in case we get called before startup by screen_resize() */ + if (!edge) + return; + for (m = 0; m < edge_monitors; m++) { for (i = 0; i < OB_NUM_EDGES; i++) { if (!config_edge_enabled[i]) @@ -123,3 +127,9 @@ void edges_shutdown(gboolean reconfigure) } g_slice_free1(sizeof(ObEdge**) * edge_monitors, edge); } + +void edges_configure() +{ + edges_shutdown(TRUE); + edges_startup(TRUE); +} diff --git a/openbox/edges.h b/openbox/edges.h index 46484044..419cba61 100644 --- a/openbox/edges.h +++ b/openbox/edges.h @@ -27,5 +27,6 @@ struct _ObEdge void edges_startup(gboolean reconfigure); void edges_shutdown(gboolean reconfigure); +void edges_configure(void); #endif diff --git a/openbox/screen.c b/openbox/screen.c index e758ada1..60f3bf91 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -20,6 +20,7 @@ #include "debug.h" #include "openbox.h" #include "dock.h" +#include "edges.h" #include "grab.h" #include "startupnotify.h" #include "moveresize.h" @@ -500,6 +501,7 @@ void screen_resize(void) /* this calls screen_update_areas(), which we need ! */ dock_configure(); + edges_configure(); for (it = client_list; it; it = g_list_next(it)) { client_move_onscreen(it->data, FALSE); -- 2.34.1