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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> On Fri, Jun 10, 2016 at 08:14:07AM -0400, Frediano Ziglio wrote:
> > > 
> > > 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)"
> > 
> > Ehm... some... I think like 60% of the keyboard :-)
> > At least all alphabetical keys are not working.
> > 
> > > I assume this is equivalent to the IMEDisableIMM() patch, but not global
> > > to the application?
> > > 
> > 
> > Yes, and the icon stay active (which is the complaint about the
> > ImmDisableIME
> > patch).
> > Yes, it's not global but window specific.
> > 
> > > > 
> > > > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > > > ---
> > > >  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
> > > 
> > 
> > Good question... using Spy or other tools looks like 2 windows are
> > created. Only win32_window does not work.
> 
> Hmm, do you think something like the snippet below could work rather
> than hardcoding the GetParent? Or maybe the GetParent only means that
> you need to call ImmAssociateContext() on gtk_widget_get_parent(display)
> as well (no idea what it is).
> 
> /* Need special handling in case gtk_widget_get_parent() is NULL? */
> parent_win32 =
> GDK_WINDOW_HWND(gtk_widget_get_window(gtk_widget_get_parent(display)));
> current_win32 = win32_window;
> while (current_win32 != parent_win32) {
>     ImmAssociateContext(current_win32, NULL);
>     current_win32 = GetParent(current_win32);
> }
> 
> Christophe
> 

This seems quite strong! I think this will remove the IME context
even from the Windows desktop :)
Would be good to understand the way Gtk created these windows.
Not sure if gtk_widget_get_parent handle is GetParent one...
Here a GTK guru would help (or some digging into the code).

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]