summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2020-08-04 15:42:18 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2020-08-04 16:37:27 +0200
commit1b345aadc36811bef511bbefa7e62c2fbc7e94cb (patch)
treeb0a21ad18b0eb35c4d1046d0359eb0478be5411e
parenta06854ca6ee2b2d6d386bcbf4dfceb7bb61dfe96 (diff)
downloadmate-panel-1b345aadc36811bef511bbefa7e62c2fbc7e94cb.tar.bz2
mate-panel-1b345aadc36811bef511bbefa7e62c2fbc7e94cb.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.
-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 44decf37..0401f388 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);