From 7617aaa923d903107ca558c3709ab29452e57af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Fri, 21 May 2021 17:04:10 +0200 Subject: [PATCH] sidebar: Use freeze_notify Closes #763 --- src/session/sidebar/selection.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/session/sidebar/selection.rs b/src/session/sidebar/selection.rs index 6eeabf76..d978efb9 100644 --- a/src/session/sidebar/selection.rs +++ b/src/session/sidebar/selection.rs @@ -168,6 +168,8 @@ impl Selection { pub fn set_model>(&self, model: Option<&P>) { let priv_ = imp::Selection::from_instance(self); + let _guard = self.freeze_notify(); + let model = model.map(|m| m.clone().upcast::()); let old_model = self.model(); @@ -306,6 +308,8 @@ impl Selection { fn items_changed_cb(&self, model: &gio::ListModel, position: u32, removed: u32, added: u32) { let priv_ = imp::Selection::from_instance(self); + let _guard = self.freeze_notify(); + let selected = self.selected(); let selected_room = self.selected_room();