[gtk+] search bar: Use GdkEvent API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] search bar: Use GdkEvent API
- Date: Tue, 19 Sep 2017 17:17:41 +0000 (UTC)
commit f43849901dfade9176b6cd272d6965e724716554
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 26 10:58:23 2017 -0400
search bar: Use GdkEvent API
gtk/gtksearchbar.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index abbae64..b34b350 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -103,7 +103,11 @@ entry_key_pressed_event_cb (GtkWidget *widget,
GdkEvent *event,
GtkSearchBar *bar)
{
- if (event->key.keyval == GDK_KEY_Escape)
+ guint keyval;
+
+ gdk_event_get_keyval (event, &keyval);
+
+ if (keyval == GDK_KEY_Escape)
{
stop_search_cb (widget, bar);
return GDK_EVENT_STOP;
@@ -130,10 +134,14 @@ gtk_search_bar_handle_event_for_entry (GtkSearchBar *bar,
guint preedit_change_id;
gboolean res;
char *old_text, *new_text;
+ guint keyval;
+
+ gdk_event_get_keyval (event, &keyval);
+
if (gtk_search_entry_is_keynav_event (event) ||
- event->key.keyval == GDK_KEY_space ||
- event->key.keyval == GDK_KEY_Menu)
+ keyval == GDK_KEY_space ||
+ keyval == GDK_KEY_Menu)
return GDK_EVENT_PROPAGATE;
if (!gtk_widget_get_realized (priv->entry))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]