[Spice-devel] [spice-gtk v2] widget: Disable IME context on display widget
Christophe Fergeau
cfergeau at redhat.com
Thu Jun 16 14:32:42 UTC 2016
On Thu, Jun 16, 2016 at 03:05:35PM +0100, Frediano Ziglio wrote:
> This prevent Windows to handle IME on the widget which cause the
> application to not receive keyboard events.
>
> To test this issue set keyboard layour to Japanese and Microsoft
'layout'
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
> IME (the default one). Set the input method to full katakana, assure
> your remote-viewer is using this method and start pressing
> alphabetical keys. On the guest (open a terminal, an editor or
> a word processor to make easier) you won't see any character.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> src/spice-widget.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> Changes from v1:
> - explain the problem in the commit message.
>
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index c528614..595c8f5 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -1687,6 +1687,15 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN
> return true;
>
> release_keys(display);
> +#ifdef G_OS_WIN32
> + /* Reset the IME context of the focused window.
> + * Note that the focused window can be different from SpiceDisplay
> + * one but the events are received and forwarder by this window. */
> + HWND hwnd_focused = GetFocus();
> + if (hwnd_focused != NULL) {
> + ImmAssociateContext(hwnd_focused, NULL);
> + }
> +#endif
> if (!d->disable_inputs)
> spice_gtk_session_sync_keyboard_modifiers(d->gtk_session);
> if (d->keyboard_grab_released)
> --
> 2.7.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160616/229fdee7/attachment.sig>
More information about the Spice-devel
mailing list