[Spice-devel] [spice-gtk] widget: Disable IME context on main widget

Christophe Fergeau cfergeau at redhat.com
Fri Jun 10 12:03:04 UTC 2016


On Fri, Jun 10, 2016 at 11:14:11AM +0100, Frediano Ziglio wrote:
> This prevent Windows to handle IME on the widget which cause the
> application to not receive keyboard event.

Would be slightly clearer as
"This prevents Windows from handling IME on the SpiceDisplay widget. If
IME is enabled, the widget is going to be unable to receive some
keyboard events (such as XXX)"
I assume this is equivalent to the IMEDisableIMM() patch, but not global
to the application?

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  src/spice-widget.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index c528614..58a1307 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -1403,6 +1403,10 @@ static void update_display(SpiceDisplay *display)
>  {
>  #ifdef G_OS_WIN32
>      win32_window = display ? GDK_WINDOW_HWND(gtk_widget_get_window(GTK_WIDGET(display))) : NULL;
> +    if (win32_window) {
> +        ImmAssociateContext(win32_window, NULL);
> +        ImmAssociateContext(GetParent(win32_window), NULL);

Why do we need to do it on the parent too? The mapping from GtkWidget
hierarchy to actual win32 window handles sounds like some private gtk+
implementation detail to me.

Christophe
-------------- 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/20160610/3d3f0333/attachment.sig>


More information about the Spice-devel mailing list