diff options
author | Benjamin Berg <bberg@redhat.com> | 2022-05-12 12:14:28 +0200 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2022-06-20 03:18:30 +0000 |
commit | cfc5fdb7c6f65379b1f6dfbb2bf741928fa9a0b5 (patch) | |
tree | 3d21803e6c4b8d6ede28b813791510c5352cd757 /shell | |
parent | 4159a5ca6858e3d281a4fd29adb54eb633c195fc (diff) | |
download | gnome-control-center-cfc5fdb7c6f65379b1f6dfbb2bf741928fa9a0b5.tar.gz |
shell: Deactivate old panel before creating new one
We need to cancel internal operations before starting to create a new
panel, otherwise panels might be creating the same object for the cache
in parallel and this is not supported by the object cache.
The alternative to this would be to handle this inside the object
store to allow parallel creation of the same key.
Fixes: #1685
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cc-panel.c | 8 | ||||
-rw-r--r-- | shell/cc-panel.h | 2 | ||||
-rw-r--r-- | shell/cc-window.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/shell/cc-panel.c b/shell/cc-panel.c index d51a8b1cd..cd3e0a813 100644 --- a/shell/cc-panel.c +++ b/shell/cc-panel.c @@ -423,3 +423,11 @@ cc_panel_set_titlebar (CcPanel *panel, priv = cc_panel_get_instance_private (panel); adw_bin_set_child (priv->titlebar_bin, titlebar); } + +void +cc_panel_deactivate (CcPanel *panel) +{ + CcPanelPrivate *priv = cc_panel_get_instance_private (panel); + + g_cancellable_cancel (priv->cancellable); +} diff --git a/shell/cc-panel.h b/shell/cc-panel.h index e9c49fad7..8cf09acee 100644 --- a/shell/cc-panel.h +++ b/shell/cc-panel.h @@ -104,4 +104,6 @@ GtkWidget* cc_panel_get_titlebar (CcPanel *panel); void cc_panel_set_titlebar (CcPanel *panel, GtkWidget *titlebar); +void cc_panel_deactivate (CcPanel *panel); + G_END_DECLS diff --git a/shell/cc-window.c b/shell/cc-window.c index 3a79b6d97..15d71247f 100644 --- a/shell/cc-window.c +++ b/shell/cc-window.c @@ -405,6 +405,8 @@ set_active_panel_from_id (CcWindow *self, * just above. */ self->old_panel = self->current_panel; + if (self->old_panel) + cc_panel_deactivate (CC_PANEL (self->old_panel)); gtk_tree_model_get (GTK_TREE_MODEL (self->store), &iter, |