summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2019-05-12 13:09:49 +0300
committermonsta <[email protected]>2019-05-20 16:03:37 +0300
commit8dd8eaa8252ed2627b5e9a384d6c58d0a74c22be (patch)
tree493cf5cc1ebe4594fe288fdeda3c235dc5f1f473
parent5e2b2a876e481ef98ed8ebd75bfa656a60253571 (diff)
downloadmate-panel-8dd8eaa8252ed2627b5e9a384d6c58d0a74c22be.tar.bz2
mate-panel-8dd8eaa8252ed2627b5e9a384d6c58d0a74c22be.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);