diff options
author | monsta <[email protected]> | 2019-05-12 13:09:49 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2019-05-20 16:10:40 +0300 |
commit | 24ad0d3a9892a424d2b605e6825b5756d282a9b2 (patch) | |
tree | 5aedadeb67d10aa57403b36474b4aa0404d84053 | |
parent | d03b63c4241ed8a8f2be15d05b15db36b871edc3 (diff) | |
download | mate-panel-24ad0d3a9892a424d2b605e6825b5756d282a9b2.tar.bz2 mate-panel-24ad0d3a9892a424d2b605e6825b5756d282a9b2.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.c | 14 |
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); |