summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-01-05 05:42:54 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-01-05 05:42:54 +0000
commit33392c7ceadb71d17b0dd1d8f474879e14cf863a (patch)
tree3ff7ac85f2b9b89fbbd1d4a46163101e64392e43
parentc4fc34bcac0372972a909facc471b96ca09ed5e7 (diff)
downloadgdk-pixbuf-33392c7ceadb71d17b0dd1d8f474879e14cf863a.tar.gz
move set_cursor after realization of the popup window, so clamp node
2007-01-04 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcombobox.c (gtk_combo_box_popup): move set_cursor after realization of the popup window, so clamp node doesn't fail. (#346616, Tommi Komulainen, patch by Kristian Rietveld). svn path=/branches/gtk-2-10/; revision=17074
-rw-r--r--ChangeLog6
-rw-r--r--gtk/gtkcombobox.c12
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 13f7932ad..84a440f4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-04 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_popup): move set_cursor
+ after realization of the popup window, so clamp node doesn't fail.
+ (#346616, Tommi Komulainen, patch by Kristian Rietveld).
+
2007-01-04 Behdad Esfahbod <behdad@gnome.org>
* gtk/gtklabel.c (get_layout_location): Fix uninitialized width
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index cd42eb8da..38c16ab79 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1661,7 +1661,7 @@ void
gtk_combo_box_popup (GtkComboBox *combo_box)
{
gint x, y, width, height;
- GtkTreePath *path, *ppath;
+ GtkTreePath *path = NULL, *ppath;
GtkWidget *toplevel;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
@@ -1696,9 +1696,6 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
if (gtk_tree_path_up (ppath))
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (combo_box->priv->tree_view),
ppath);
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (combo_box->priv->tree_view),
- path, NULL, FALSE);
- gtk_tree_path_free (path);
gtk_tree_path_free (ppath);
}
gtk_tree_view_set_hover_expand (GTK_TREE_VIEW (combo_box->priv->tree_view),
@@ -1707,6 +1704,13 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
/* popup */
gtk_widget_show (combo_box->priv->popup_window);
+ if (path)
+ {
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (combo_box->priv->tree_view),
+ path, NULL, FALSE);
+ gtk_tree_path_free (path);
+ }
+
gtk_widget_grab_focus (combo_box->priv->popup_window);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo_box->priv->button),
TRUE);