summaryrefslogtreecommitdiff
path: root/gtk/gtkmain.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-05-22 12:37:37 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-05-24 15:19:01 +0100
commitd68e312c2b7b2679f7ee3d835d0d378eeb6704a6 (patch)
tree2d8c01935b35c9cc54aea7531992d429f3b9aced /gtk/gtkmain.c
parent0cf5b66e7b0fda0857f18be602184e2891d9b6ae (diff)
downloadgtk+-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.c9
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