diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-05-22 12:37:37 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-05-24 15:19:01 +0100 |
commit | d68e312c2b7b2679f7ee3d835d0d378eeb6704a6 (patch) | |
tree | 2d8c01935b35c9cc54aea7531992d429f3b9aced /gtk/gtkmain.c | |
parent | 0cf5b66e7b0fda0857f18be602184e2891d9b6ae (diff) | |
download | gtk+-d68e312c2b7b2679f7ee3d835d0d378eeb6704a6.tar.gz |
Use the private GdkKeyEvent.translated_key getter
We can avoid poking directly at the GdkKeyEvent structure, now.
Diffstat (limited to 'gtk/gtkmain.c')
-rw-r--r-- | gtk/gtkmain.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 4b411e475f..e54e603bf4 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1244,8 +1244,8 @@ static GdkEvent * rewrite_event_for_toplevel (GdkEvent *event) { GdkSurface *surface; - GdkKeyEvent *key_event; GdkEventType event_type; + GdkTranslatedKey *key, *key_no_lock; surface = gdk_event_get_surface (event); if (!surface->parent) @@ -1259,9 +1259,9 @@ rewrite_event_for_toplevel (GdkEvent *event) while (surface->parent) surface = surface->parent; - key_event = (GdkKeyEvent *) event; + key = gdk_key_event_get_translated_key (event, FALSE); + key_no_lock = gdk_key_event_get_translated_key (event, TRUE); - /* FIXME: Avoid direct access to the translated[] field */ return gdk_key_event_new (gdk_event_get_event_type (event), surface, gdk_event_get_device (event), @@ -1270,8 +1270,7 @@ rewrite_event_for_toplevel (GdkEvent *event) gdk_key_event_get_keycode (event), gdk_event_get_modifier_state (event), gdk_key_event_is_modifier (event), - &key_event->translated[0], - &key_event->translated[1]); + key, key_no_lock); } static gboolean |