From 69d2459471e36309f63b651b18da1ed3fdedc148 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Thu, 16 Feb 2017 20:36:36 +0000 Subject: =?UTF-8?q?combobox=E2=80=94Remove=20useless=20button-press-event?= =?UTF-8?q?=20handler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use toggled, which does everything we need; this adds nothing useful. Credit to Timm for noticing this—I didn’t when moving it to the ui file. --- gtk/gtkcombobox.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'gtk/gtkcombobox.c') diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 8b67b39b2a..3bb5d8c4dd 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -286,9 +286,6 @@ static void gtk_combo_box_model_row_changed (GtkTreeModel *model, GtkTreeIter *iter, gpointer data); -static gboolean gtk_combo_box_menu_button_press (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data); static void gtk_combo_box_menu_activate (GtkWidget *menu, const gchar *path, GtkComboBox *combo_box); @@ -971,7 +968,6 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) gtk_widget_class_bind_template_child_internal_private (widget_class, GtkComboBox, area); gtk_widget_class_bind_template_child_internal_private (widget_class, GtkComboBox, popup_widget); gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_button_toggled); - gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_button_press); gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_activate); gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_key_press); gtk_widget_class_bind_template_callback (widget_class, gtk_combo_box_menu_show); @@ -1977,28 +1973,6 @@ gtk_combo_box_scroll_event (GtkWidget *widget, } /* callbacks */ -static gboolean -gtk_combo_box_menu_button_press (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data) -{ - GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); - GtkComboBoxPrivate *priv = combo_box->priv; - - if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_PRIMARY) - { - if (gtk_widget_get_focus_on_click (GTK_WIDGET (combo_box)) && - !gtk_widget_has_focus (priv->button)) - gtk_widget_grab_focus (priv->button); - - gtk_combo_box_menu_popup (combo_box, (const GdkEvent *) event); - - return TRUE; - } - - return FALSE; -} - static void gtk_combo_box_menu_activate (GtkWidget *menu, const gchar *path, -- cgit v1.2.1