Use g_signal_connect_object() to prevent premature finalization of the

2004-10-28  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcombobox.c (gtk_combo_box_start_editing): Use
	g_signal_connect_object() to prevent premature finalization
	of the cell_editable while the key_press_event signal is
	handled.  (#156325, Olivier Andrieu)
This commit is contained in:
Matthias Clasen 2004-10-28 16:50:10 +00:00 committed by Matthias Clasen
parent d5f92150d4
commit b6aa6f0fa9
5 changed files with 28 additions and 10 deletions

View File

@ -1,5 +1,10 @@
2004-10-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_start_editing): Use
g_signal_connect_object() to prevent premature finalization
of the cell_editable while the key_press_event signal is
handled. (#156325, Olivier Andrieu)
* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)
* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect

View File

@ -1,5 +1,10 @@
2004-10-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_start_editing): Use
g_signal_connect_object() to prevent premature finalization
of the cell_editable while the key_press_event signal is
handled. (#156325, Olivier Andrieu)
* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)
* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect

View File

@ -1,5 +1,10 @@
2004-10-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_start_editing): Use
g_signal_connect_object() to prevent premature finalization
of the cell_editable while the key_press_event signal is
handled. (#156325, Olivier Andrieu)
* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)
* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect

View File

@ -1,5 +1,10 @@
2004-10-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_start_editing): Use
g_signal_connect_object() to prevent premature finalization
of the cell_editable while the key_press_event signal is
handled. (#156325, Olivier Andrieu)
* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)
* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect

View File

@ -4714,10 +4714,8 @@ gtk_cell_editable_key_press (GtkWidget *widget,
}
else if (event->keyval == GDK_Return)
{
if (GTK_IS_CELL_EDITABLE (combo_box))
gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
if (GTK_IS_CELL_EDITABLE (combo_box))
gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box));
gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box));
return TRUE;
}
@ -4785,17 +4783,17 @@ gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
if (combo_box->priv->cell_view)
{
g_signal_connect (combo_box->priv->button, "key_press_event",
G_CALLBACK (gtk_cell_editable_key_press),
cell_editable);
g_signal_connect_object (combo_box->priv->button, "key_press_event",
G_CALLBACK (gtk_cell_editable_key_press),
cell_editable, 0);
gtk_widget_grab_focus (combo_box->priv->button);
}
else
{
g_signal_connect (GTK_BIN (combo_box)->child, "key_press_event",
G_CALLBACK (gtk_cell_editable_key_press),
cell_editable);
g_signal_connect_object (GTK_BIN (combo_box)->child, "key_press_event",
G_CALLBACK (gtk_cell_editable_key_press),
cell_editable, 0);
gtk_widget_grab_focus (GTK_WIDGET (GTK_BIN (combo_box)->child));
GTK_WIDGET_UNSET_FLAGS (combo_box->priv->button, GTK_CAN_FOCUS);