From 061b9024ed51cf4f8a2a58484874daa481075734 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 26 Feb 2004 22:40:12 +0000 Subject: [PATCH] Fixes for #135333, analysed by Damon Chaplin: Thu Feb 26 23:39:07 2004 Matthias Clasen Fixes for #135333, analysed by Damon Chaplin: * gtk/gtkcombobox.c (gtk_combo_box_list_button_pressed): Don't grab here. * gtk/gtkcombobox.c (gtk_combo_box_popup): Do the grabs here, so that we don't forget to grab when the menu is popped via keynav. * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): Don't ungrab here. * gtk/gtkcombobox.c (gtk_combo_box_popdown): Do the ungrabs here. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ ChangeLog.pre-2-4 | 13 +++++++++++++ ChangeLog.pre-2-6 | 13 +++++++++++++ ChangeLog.pre-2-8 | 13 +++++++++++++ gtk/gtkcombobox.c | 25 ++++++++++--------------- 6 files changed, 75 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8adaf74b7..7d781581d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Feb 26 23:39:07 2004 Matthias Clasen + + Fixes for #135333, analysed by Damon Chaplin: + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_pressed): Don't + grab here. + * gtk/gtkcombobox.c (gtk_combo_box_popup): Do the grabs here, + so that we don't forget to grab when the menu is popped via + keynav. + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): Don't + ungrab here. + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Do the ungrabs here. + Thu Feb 26 23:26:00 2004 Soeren Sandmann * gtk/gtkstatusbar.c (set_grip_cursor): New function. Use resize diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8adaf74b7..7d781581d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Thu Feb 26 23:39:07 2004 Matthias Clasen + + Fixes for #135333, analysed by Damon Chaplin: + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_pressed): Don't + grab here. + * gtk/gtkcombobox.c (gtk_combo_box_popup): Do the grabs here, + so that we don't forget to grab when the menu is popped via + keynav. + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): Don't + ungrab here. + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Do the ungrabs here. + Thu Feb 26 23:26:00 2004 Soeren Sandmann * gtk/gtkstatusbar.c (set_grip_cursor): New function. Use resize diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8adaf74b7..7d781581d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Thu Feb 26 23:39:07 2004 Matthias Clasen + + Fixes for #135333, analysed by Damon Chaplin: + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_pressed): Don't + grab here. + * gtk/gtkcombobox.c (gtk_combo_box_popup): Do the grabs here, + so that we don't forget to grab when the menu is popped via + keynav. + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): Don't + ungrab here. + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Do the ungrabs here. + Thu Feb 26 23:26:00 2004 Soeren Sandmann * gtk/gtkstatusbar.c (set_grip_cursor): New function. Use resize diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8adaf74b7..7d781581d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Thu Feb 26 23:39:07 2004 Matthias Clasen + + Fixes for #135333, analysed by Damon Chaplin: + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_pressed): Don't + grab here. + * gtk/gtkcombobox.c (gtk_combo_box_popup): Do the grabs here, + so that we don't forget to grab when the menu is popped via + keynav. + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): Don't + ungrab here. + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Do the ungrabs here. + Thu Feb 26 23:26:00 2004 Soeren Sandmann * gtk/gtkstatusbar.c (set_grip_cursor): New function. Use resize diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8adaf74b7..7d781581d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Thu Feb 26 23:39:07 2004 Matthias Clasen + + Fixes for #135333, analysed by Damon Chaplin: + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_pressed): Don't + grab here. + * gtk/gtkcombobox.c (gtk_combo_box_popup): Do the grabs here, + so that we don't forget to grab when the menu is popped via + keynav. + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released): Don't + ungrab here. + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Do the ungrabs here. + Thu Feb 26 23:26:00 2004 Soeren Sandmann * gtk/gtkstatusbar.c (set_grip_cursor): New function. Use resize diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index f02031ad8..265fdfe65 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -885,6 +885,15 @@ gtk_combo_box_popup (GtkComboBox *combo_box) FALSE, GDK_CURRENT_TIME); gtk_widget_grab_focus (combo_box->priv->tree_view); } + + gtk_grab_add (combo_box->priv->popup_window); + gdk_pointer_grab (combo_box->priv->popup_window->window, TRUE, + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, + NULL, NULL, GDK_CURRENT_TIME); + + gtk_grab_add (combo_box->priv->tree_view); } /** @@ -909,6 +918,7 @@ gtk_combo_box_popdown (GtkComboBox *combo_box) return; } + gtk_combo_box_list_remove_grabs (combo_box); gtk_widget_hide_all (combo_box->priv->popup_window); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo_box->priv->button), FALSE); @@ -1974,15 +1984,6 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget, gtk_combo_box_popup (combo_box); - gtk_grab_add (combo_box->priv->popup_window); - gdk_pointer_grab (combo_box->priv->popup_window->window, TRUE, - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, GDK_CURRENT_TIME); - - gtk_grab_add (combo_box->priv->tree_view); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo_box->priv->button), TRUE); @@ -2017,7 +2018,6 @@ gtk_combo_box_list_button_released (GtkWidget *widget, !popup_in_progress && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (combo_box->priv->button))) { - gtk_combo_box_list_remove_grabs (combo_box); gtk_combo_box_popdown (combo_box); return TRUE; } @@ -2025,7 +2025,6 @@ gtk_combo_box_list_button_released (GtkWidget *widget, /* released outside treeview */ if (ewidget != combo_box->priv->button) { - gtk_combo_box_list_remove_grabs (combo_box); gtk_combo_box_popdown (combo_box); return TRUE; @@ -2034,9 +2033,6 @@ gtk_combo_box_list_button_released (GtkWidget *widget, return FALSE; } - /* drop grabs */ - gtk_combo_box_list_remove_grabs (combo_box); - /* select something cool */ ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), event->x, event->y, @@ -2090,7 +2086,6 @@ gtk_combo_box_list_key_press (GtkWidget *widget, gtk_combo_box_set_active (combo_box, gtk_combo_box_get_active (combo_box)); - gtk_combo_box_list_remove_grabs (combo_box); gtk_combo_box_popdown (combo_box); return TRUE;