[gimp/gimp-2-8] app: set GimpContainerTreeView->dnd_renderer to NULL more reliably
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] app: set GimpContainerTreeView->dnd_renderer to NULL more reliably
- Date: Tue, 22 May 2012 11:05:47 +0000 (UTC)
commit e2ad99b98ee7f340ccffaa9de290d7ba4ad17a61
Author: Michael Natterer <mitch gimp org>
Date: Tue May 22 12:58:10 2012 +0200
app: set GimpContainerTreeView->dnd_renderer to NULL more reliably
specifically in button_release() and when the container changes, we
can badly crash in some situations otherwise.
(cherry picked from commit 27a767ee5499f862d481fb4c49bb51041b8325ad)
app/widgets/gimpcontainertreeview.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index f14eb28..6b0ae00 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -102,6 +102,9 @@ static void gimp_container_tree_view_selection_changed (GtkTreeSelectio
static gboolean gimp_container_tree_view_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpContainerTreeView *tree_view);
+static gboolean gimp_container_tree_view_button_release (GtkWidget *widget,
+ GdkEventButton *bevent,
+ GimpContainerTreeView *tree_view);
static gboolean gimp_container_tree_view_tooltip (GtkWidget *widget,
gint x,
gint y,
@@ -522,6 +525,8 @@ gimp_container_tree_view_set_container (GimpContainerView *view,
if (old_container)
{
+ tree_view->priv->dnd_renderer = NULL;
+
g_signal_handlers_disconnect_by_func (tree_view->view,
gimp_container_tree_view_row_expanded,
tree_view);
@@ -539,6 +544,9 @@ gimp_container_tree_view_set_container (GimpContainerView *view,
g_signal_handlers_disconnect_by_func (tree_view->view,
gimp_container_tree_view_button_press,
tree_view);
+ g_signal_handlers_disconnect_by_func (tree_view->view,
+ gimp_container_tree_view_button_release,
+ tree_view);
}
}
else if (container)
@@ -565,6 +573,9 @@ gimp_container_tree_view_set_container (GimpContainerView *view,
g_signal_connect (tree_view->view, "button-press-event",
G_CALLBACK (gimp_container_tree_view_button_press),
tree_view);
+ g_signal_connect (tree_view->view, "button-release-event",
+ G_CALLBACK (gimp_container_tree_view_button_release),
+ tree_view);
}
parent_view_iface->set_container (view, container);
@@ -1180,6 +1191,16 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
}
static gboolean
+gimp_container_tree_view_button_release (GtkWidget *widget,
+ GdkEventButton *bevent,
+ GimpContainerTreeView *tree_view)
+{
+ tree_view->priv->dnd_renderer = NULL;
+
+ return FALSE;
+}
+
+static gboolean
gimp_container_tree_view_tooltip (GtkWidget *widget,
gint x,
gint y,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]