summaryrefslogtreecommitdiff
path: root/gtk/gtkimcontextsimple.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-15 09:55:58 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-21 00:40:52 -0500
commitdac61b3cce500ffe7057397de3c69329f9f2969d (patch)
treea54443ffe9fa746cd1b8528c4c6dcb6797e34b4b /gtk/gtkimcontextsimple.c
parent080e5de78634c6c8fb49b97f42b442f49e28b567 (diff)
downloadgtk+-dac61b3cce500ffe7057397de3c69329f9f2969d.tar.gz
imcontextsimple: Use event constructors
Diffstat (limited to 'gtk/gtkimcontextsimple.c')
-rw-r--r--gtk/gtkimcontextsimple.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 730f4bac0a..f2cd39d9ed 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -913,10 +913,20 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
gtk_im_context_simple_commit_char (context, priv->tentative_match);
priv->compose_buffer[0] = 0;
- for (i=0; i < n_compose - len - 1; i++)
+ for (i = 0; i < n_compose - len - 1; i++)
{
- GdkEvent *tmp_event = gdk_event_copy ((GdkEvent *)event);
- gdk_event_set_keyval (tmp_event, priv->compose_buffer[len + i]);
+ guint tmp_keyval = priv->compose_buffer[len + i];
+ GdkEvent *tmp_event = gdk_event_key_new (GDK_KEY_PRESS,
+ event->any.surface,
+ event->any.device,
+ event->any.source_device,
+ event->time,
+ event->state,
+ tmp_keyval,
+ tmp_keyval,
+ tmp_keyval,
+ 0,
+ 0);
gtk_im_context_filter_keypress (context, (GdkEventKey *)tmp_event);
g_object_unref (tmp_event);