[gimp] app: ignore gimp_container_view_{select, activate, context}_item() ...



commit 88c63420e8390e78479ed693afb748f8a5c86ccb
Author: Ell <ell_se yahoo com>
Date:   Mon May 7 01:59:30 2018 -0400

    app: ignore gimp_container_view_{select,activate,context}_item() ...
    
    ... while the container is frozen
    
    In GimpContainerView, do nothing in response to a
    gimp_container_view_{select,activate,context}_item() call while the
    view's container is frozen.  While the container is frozen the view
    is empty, and these functions can segfault.

 app/widgets/gimpcontainerview.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpcontainerview.c b/app/widgets/gimpcontainerview.c
index e95adfc..34c5f08 100644
--- a/app/widgets/gimpcontainerview.c
+++ b/app/widgets/gimpcontainerview.c
@@ -662,6 +662,9 @@ gimp_container_view_select_item (GimpContainerView *view,
 
   private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
 
+  if (gimp_container_frozen (private->container))
+    return TRUE;
+
   insert_data = g_hash_table_lookup (private->item_hash, viewable);
 
   g_signal_emit (view, view_signals[SELECT_ITEM], 0,
@@ -682,6 +685,9 @@ gimp_container_view_activate_item (GimpContainerView *view,
 
   private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
 
+  if (gimp_container_frozen (private->container))
+    return;
+
   insert_data = g_hash_table_lookup (private->item_hash, viewable);
 
   g_signal_emit (view, view_signals[ACTIVATE_ITEM], 0,
@@ -700,6 +706,9 @@ gimp_container_view_context_item (GimpContainerView *view,
 
   private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
 
+  if (gimp_container_frozen (private->container))
+    return;
+
   insert_data = g_hash_table_lookup (private->item_hash, viewable);
 
   g_signal_emit (view, view_signals[CONTEXT_ITEM], 0,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]