summaryrefslogtreecommitdiff
path: root/gtk/gtkimcontextsimple.c
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2018-04-26 17:42:49 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2018-04-26 17:50:55 +0000
commit76855e89994498a0fae5405623d594c98dcbe230 (patch)
treed855388c1bce085b73d1314e53da0c1c5ee1cef4 /gtk/gtkimcontextsimple.c
parentb0bb7f3da4b174edc6e3e080849bf1ab950c3818 (diff)
downloadgtk+-76855e89994498a0fae5405623d594c98dcbe230.tar.gz
imcontextsimple: ensure W32 code only runs on W32 displays
gdk_win32_keymap_check_compose() shouldn't be called for non-W32 displays (i.e. when using broadway or other backends that could be made to run on Windows).
Diffstat (limited to 'gtk/gtkimcontextsimple.c')
-rw-r--r--gtk/gtkimcontextsimple.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index af41cc5d14..3ba25d2765 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -1238,28 +1238,31 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
gboolean success = FALSE;
#ifdef GDK_WINDOWING_WIN32
- guint16 output[2];
- gsize output_size = 2;
-
- switch (gdk_win32_keymap_check_compose (GDK_WIN32_KEYMAP (keymap),
- priv->compose_buffer,
- n_compose,
- output, &output_size))
+ if (GDK_IS_WIN32_DISPLAY (display))
{
- case GDK_WIN32_KEYMAP_MATCH_NONE:
- break;
- case GDK_WIN32_KEYMAP_MATCH_EXACT:
- case GDK_WIN32_KEYMAP_MATCH_PARTIAL:
- for (i = 0; i < output_size; i++)
+ guint16 output[2];
+ gsize output_size = 2;
+
+ switch (gdk_win32_keymap_check_compose (GDK_WIN32_KEYMAP (keymap),
+ priv->compose_buffer,
+ n_compose,
+ output, &output_size))
{
- output_char = gdk_keyval_to_unicode (output[i]);
- gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple),
- output_char);
+ case GDK_WIN32_KEYMAP_MATCH_NONE:
+ break;
+ case GDK_WIN32_KEYMAP_MATCH_EXACT:
+ case GDK_WIN32_KEYMAP_MATCH_PARTIAL:
+ for (i = 0; i < output_size; i++)
+ {
+ output_char = gdk_keyval_to_unicode (output[i]);
+ gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple),
+ output_char);
+ }
+ priv->compose_buffer[0] = 0;
+ return TRUE;
+ case GDK_WIN32_KEYMAP_MATCH_INCOMPLETE:
+ return TRUE;
}
- priv->compose_buffer[0] = 0;
- return TRUE;
- case GDK_WIN32_KEYMAP_MATCH_INCOMPLETE:
- return TRUE;
}
#endif