summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-10 19:02:23 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-16 14:14:10 -0500
commitfa0f6372683fd62e798151baa80d9321a1637d83 (patch)
treea64b87ed8b96bd3bd708926f41f5669d90999803
parent4b613c2f6a6788c2cd11ccc3bd9019cd44411318 (diff)
downloadgtk+-fa0f6372683fd62e798151baa80d9321a1637d83.tar.gz
entry completion: Drop another ::button-press-event handler
This one will be replaced by a generic ::event handler.
-rw-r--r--gtk/gtkentrycompletion.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index c4a0ccdcba..ae3f895b42 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -142,8 +142,8 @@ static gboolean gtk_entry_completion_visible_func (GtkTreeModel *mo
static gboolean gtk_entry_completion_popup_key_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data);
-static gboolean gtk_entry_completion_popup_button_press (GtkWidget *widget,
- GdkEventButton *event,
+static gboolean gtk_entry_completion_popup_event (GtkWidget *widget,
+ GdkEvent *event,
gpointer user_data);
static void gtk_entry_completion_list_activated (GtkTreeView *treeview,
GtkTreePath *path,
@@ -603,8 +603,8 @@ gtk_entry_completion_constructed (GObject *object)
g_signal_connect (priv->popup_window, "key-release-event",
G_CALLBACK (gtk_entry_completion_popup_key_event),
completion);
- g_signal_connect (priv->popup_window, "button-press-event",
- G_CALLBACK (gtk_entry_completion_popup_button_press),
+ g_signal_connect (priv->popup_window, "event",
+ G_CALLBACK (gtk_entry_completion_popup_event),
completion);
popup_frame = gtk_frame_new (NULL);
@@ -914,19 +914,22 @@ gtk_entry_completion_popup_key_event (GtkWidget *widget,
}
static gboolean
-gtk_entry_completion_popup_button_press (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
+gtk_entry_completion_popup_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
{
GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (user_data);
+ if (gdk_event_get_event_type (event) != GDK_BUTTON_PRESS)
+ return GDK_EVENT_PROPAGATE;
+
if (!gtk_widget_get_mapped (completion->priv->popup_window))
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
/* if we come here, it's usually time to popdown */
_gtk_entry_completion_popdown (completion);
- return TRUE;
+ return GDK_EVENT_STOP;
}
static void