summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2019-05-12 13:09:49 +0300
committermonsta <[email protected]>2019-05-20 16:05:20 +0300
commitbbd5a7b29c3dd3d3179b48f8e7ef368d45451253 (patch)
treec45660931acf5606e4c0ea69d3120a331eaf2047
parent75b4b08fb22d9df832ccccb7f42042abb0d09372 (diff)
downloadmate-panel-bbd5a7b29c3dd3d3179b48f8e7ef368d45451253.tar.bz2
mate-panel-bbd5a7b29c3dd3d3179b48f8e7ef368d45451253.tar.xz
fix reloading the default layout after panel reset
- do it in the idle handler - wait until all toplevels are destroyed before reloading the layout
-rw-r--r--mate-panel/panel-profile.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index 79415460..7d787755 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -1435,6 +1435,18 @@ panel_profile_delete_removed_ids (PanelGSettingsKeyType type,
g_slist_free (removed_ids);
}
+static gboolean
+load_default_layout_idle (gpointer unused) {
+ if (g_slist_length (panel_toplevel_list_toplevels ()) != 0) {
+ /* some toplevels are not destroyed yet, waiting */
+ return TRUE;
+ }
+
+ /* load the default layout and stop this handler */
+ panel_profile_ensure_toplevel_per_screen ();
+ return FALSE;
+}
+
static void
panel_profile_toplevel_id_list_notify (GSettings *settings,
gchar *key,
@@ -1477,7 +1489,7 @@ panel_profile_toplevel_id_list_notify (GSettings *settings,
/* if there are no panels, reset layout to default */
if (g_slist_length (toplevel_ids) == 0)
- panel_profile_ensure_toplevel_per_screen ();
+ g_idle_add (load_default_layout_idle, NULL);
g_slist_free (existing_toplevels);
g_slist_free (toplevel_ids);