[gtk+] modules/input/gtkimcontextime.c: Fix build
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] modules/input/gtkimcontextime.c: Fix build
- Date: Tue, 24 Oct 2017 16:54:26 +0000 (UTC)
commit a65730f38f30cee575c5a058f2d0706c39f419df
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Oct 24 16:06:32 2017 +0800
modules/input/gtkimcontextime.c: Fix build
The GdkEvent structure became opaque, so we need to update the code so
that we use the getters and setters here.
https://bugzilla.gnome.org/show_bug?id=773299
modules/input/gtkimcontextime.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/modules/input/gtkimcontextime.c b/modules/input/gtkimcontextime.c
index 372050f..cc46535 100644
--- a/modules/input/gtkimcontextime.c
+++ b/modules/input/gtkimcontextime.c
@@ -374,14 +374,18 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
GtkIMContextIME *context_ime;
gboolean retval = FALSE;
guint32 c;
+ GdkModifierType state;
+ guint keyval;
g_return_val_if_fail (GTK_IS_IM_CONTEXT_IME (context), FALSE);
g_return_val_if_fail (event, FALSE);
- if (event->type == GDK_KEY_RELEASE)
+ if (gdk_event_get_event_type ((GdkEvent *) event) == GDK_KEY_RELEASE)
return FALSE;
- if (event->state & GDK_CONTROL_MASK)
+ gdk_event_get_state ((GdkEvent *) event, &state);
+
+ if (state & GDK_CONTROL_MASK)
return FALSE;
context_ime = GTK_IM_CONTEXT_IME (context);
@@ -392,7 +396,9 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
if (!GDK_IS_WINDOW (context_ime->client_window))
return FALSE;
- if (event->keyval == GDK_KEY_space &&
+ gdk_event_get_keyval ((GdkEvent *) event, &keyval);
+
+ if (keyval == GDK_KEY_space &&
context_ime->priv->dead_key_keyval != 0)
{
c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);
@@ -401,21 +407,21 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
return TRUE;
}
- c = gdk_keyval_to_unicode (event->keyval);
+ c = gdk_keyval_to_unicode (keyval);
if (c)
{
_gtk_im_context_ime_commit_unichar (context_ime, c);
retval = TRUE;
}
- else if (IS_DEAD_KEY (event->keyval))
+ else if (IS_DEAD_KEY (keyval))
{
gunichar dead_key;
- dead_key = _gtk_im_context_ime_dead_key_unichar (event->keyval, FALSE);
+ dead_key = _gtk_im_context_ime_dead_key_unichar (keyval, FALSE);
/* Emulate double input of dead keys */
- if (dead_key && event->keyval == context_ime->priv->dead_key_keyval)
+ if (dead_key && keyval == context_ime->priv->dead_key_keyval)
{
c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);
context_ime->priv->dead_key_keyval = 0;
@@ -423,7 +429,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
_gtk_im_context_ime_commit_unichar (context_ime, c);
}
else
- context_ime->priv->dead_key_keyval = event->keyval;
+ context_ime->priv->dead_key_keyval = keyval;
}
return retval;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]