[gimp] app: don't let gtk_tree_store_clear() mess with our selected item
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: don't let gtk_tree_store_clear() mess with our selected item
- Date: Sun, 3 Jun 2018 19:47:19 +0000 (UTC)
commit 3f954350d90ebb2c20204ea229bbcfe11704f17c
Author: Michael Natterer <mitch gimp org>
Date: Sun Jun 3 21:45:16 2018 +0200
app: don't let gtk_tree_store_clear() mess with our selected item
gimp_container_tree_view_clear_items(): GTK+ 3.x always keeps the row
with the cursor selected, so we get a gazillion selection changed
during gtk_tree_store_clear(), block our selection changed handler
during the clear.
app/widgets/gimpcontainertreeview.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 835cce4a36..610972e5f6 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -922,8 +922,19 @@ gimp_container_tree_view_clear_items (GimpContainerView *view)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
+ /* GTK+ 3.x always keeps the row with the cursor selected, so we get
+ * a gazillion selection changed during gtk_tree_store_clear()
+ */
+ g_signal_handlers_block_by_func (tree_view->priv->selection,
+ gimp_container_tree_view_selection_changed,
+ tree_view);
+
gimp_container_tree_store_clear_items (GIMP_CONTAINER_TREE_STORE (tree_view->model));
+ g_signal_handlers_unblock_by_func (tree_view->priv->selection,
+ gimp_container_tree_view_selection_changed,
+ tree_view);
+
parent_view_iface->clear_items (view);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]