summaryrefslogtreecommitdiff
path: root/mate-panel/panel-profile.c
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2020-08-04 15:42:18 +0200
committerrbuj <[email protected]>2020-08-04 16:38:38 +0200
commitdecfcebaa4a07f38789bca6443479b350d3132df (patch)
tree6776e0eab7d0c5331462e3a8d43086e3b7d19b3f /mate-panel/panel-profile.c
parente9163da19693a6268a83d25ffd4472e8e0590d7d (diff)
downloadmate-panel-decfcebaa4a07f38789bca6443479b350d3132df.tar.bz2
mate-panel-decfcebaa4a07f38789bca6443479b350d3132df.tar.xz
Fix creating several launchers at once
When creating a new launcher, we try and find an available object ID by browsing the existing ones. This however fails to take into account objects that were created but that didn't make it to the backend yet, leading to likely re-using the same ID when creating several objects roughly at the same time. This happens e.g. when dropping several URIs together.
Diffstat (limited to 'mate-panel/panel-profile.c')
-rw-r--r--mate-panel/panel-profile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index 328ffab7..f7a3331f 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -1236,6 +1236,11 @@ panel_profile_prepare_object_with_id (PanelObjectType object_type,
g_settings_set_int (settings, PANEL_OBJECT_POSITION_KEY, position);
g_settings_set_boolean (settings, PANEL_OBJECT_PANEL_RIGHT_STICK_KEY, right_stick);
+ /* Force writing the settings in order to reserve the object ID *now*,
+ * so that a later call to panel_profile_find_new_id() won't find the same
+ * one. */
+ g_settings_sync ();
+
g_free (settings_path);
g_object_unref (settings);