From 356c249aab90c722d6510acbec36aa656cce18dc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 8 Oct 2004 17:09:18 +0000 Subject: [PATCH] Set the cell renderer to inert mode to avoid bug #154921. This fixes a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gtk/gtkfilechooserdefault.c (renderer_edited_cb): Set the cell renderer to inert mode to avoid bug #154921. This fixes a crash which would otherwise occur if the editing is stopped for the second time. (#154767, Manuel Baena García) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkfilechooserdefault.c | 10 ++++++++-- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ffacbbcde..5836937513 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-10-08 Matthias Clasen + * gtk/gtkfilechooserdefault.c (renderer_edited_cb): Set the cell + renderer to inert mode to avoid bug #154921. This fixes a crash + which would otherwise occur if the editing is stopped for the second + time. (#154767, Manuel Baena García) + * gtk/gtkdebug.h: * gtk/gtkwidget.c (gtk_widget_size_allocate): Add a new debug flag, geometry, to debug size allocation. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4ffacbbcde..5836937513 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,10 @@ 2004-10-08 Matthias Clasen + * gtk/gtkfilechooserdefault.c (renderer_edited_cb): Set the cell + renderer to inert mode to avoid bug #154921. This fixes a crash + which would otherwise occur if the editing is stopped for the second + time. (#154767, Manuel Baena García) + * gtk/gtkdebug.h: * gtk/gtkwidget.c (gtk_widget_size_allocate): Add a new debug flag, geometry, to debug size allocation. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4ffacbbcde..5836937513 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,10 @@ 2004-10-08 Matthias Clasen + * gtk/gtkfilechooserdefault.c (renderer_edited_cb): Set the cell + renderer to inert mode to avoid bug #154921. This fixes a crash + which would otherwise occur if the editing is stopped for the second + time. (#154767, Manuel Baena García) + * gtk/gtkdebug.h: * gtk/gtkwidget.c (gtk_widget_size_allocate): Add a new debug flag, geometry, to debug size allocation. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4ffacbbcde..5836937513 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,10 @@ 2004-10-08 Matthias Clasen + * gtk/gtkfilechooserdefault.c (renderer_edited_cb): Set the cell + renderer to inert mode to avoid bug #154921. This fixes a crash + which would otherwise occur if the editing is stopped for the second + time. (#154767, Manuel Baena García) + * gtk/gtkdebug.h: * gtk/gtkwidget.c (gtk_widget_size_allocate): Add a new debug flag, geometry, to debug size allocation. diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 22ee3fa141..11ccc420be 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1627,7 +1627,10 @@ renderer_edited_cb (GtkCellRendererText *cell_renderer_text, const gchar *new_text, GtkFileChooserDefault *impl) { - queue_edited_idle (impl, new_text); + /* work around bug #154921 */ + g_object_set (cell_renderer_text, + "mode", GTK_CELL_RENDERER_MODE_INERT, NULL); + queue_edited_idle (impl, new_text); } /* Callback used from the text cell renderer when the new folder edition gets @@ -1637,7 +1640,10 @@ static void renderer_editing_canceled_cb (GtkCellRendererText *cell_renderer_text, GtkFileChooserDefault *impl) { - queue_edited_idle (impl, NULL); + /* work around bug #154921 */ + g_object_set (cell_renderer_text, + "mode", GTK_CELL_RENDERER_MODE_INERT, NULL); + queue_edited_idle (impl, NULL); } /* Creates the widgets for the filter combo box */