Fix refcounting issues with new_event and its window.

2005-12-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_key_press): Fix refcounting
	issues with new_event and its window.
This commit is contained in:
Matthias Clasen 2005-12-06 18:03:50 +00:00 committed by Matthias Clasen
parent 62c1d36a67
commit 4174446a6d
3 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2005-12-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_key_press): Fix refcounting
issues with new_event and its window.
* gtk/gtkmenu.c (gtk_menu_attach_to_widget): Accept NULL
as a detach func. (#323386, Jorn Baayen)

View File

@ -1,5 +1,8 @@
2005-12-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_key_press): Fix refcounting
issues with new_event and its window.
* gtk/gtkmenu.c (gtk_menu_attach_to_widget): Accept NULL
as a detach func. (#323386, Jorn Baayen)

View File

@ -4447,7 +4447,8 @@ gtk_tree_view_key_press (GtkWidget *widget,
/* Make a copy of the current text */
old_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (tree_view->priv->search_entry)));
new_event = gdk_event_copy ((GdkEvent *) event);
((GdkEventKey *) new_event)->window = tree_view->priv->search_entry->window;
g_object_unref (((GdkEventKey *) new_event)->window);
((GdkEventKey *) new_event)->window = g_object_ref (tree_view->priv->search_entry->window);
gtk_widget_realize (tree_view->priv->search_window);
popup_menu_id = g_signal_connect (tree_view->priv->search_entry,