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

Frediano Ziglio fziglio at redhat.com
Mon Jun 13 10:07:53 UTC 2016


> 
> On Fri, Jun 10, 2016 at 08:45:56AM -0400, Frediano Ziglio wrote:
> > 
> > This seems quite strong! I think this will remove the IME context
> > even from the Windows desktop :)
> 
> Oh? I just assumed that the win32 hierarchy was more or less the same as
> the GTK+ hierarchy, and that iterating win32 windows between the current
> GTK+ widget and it's GTK+ parent would let us not hardcode just one
> GetParent()
> 
> Forget it if it's all wrong ;)
> 
> Christophe
> 

Added some debug to the code to understand the hierarchy.
The HWND parent of the widget if the HWND of GTK parent so at
least for these 2 classes there is a 1-to-1 relationship.
These first 2 windows have the same exact size and position
taking all client area (without title and borders) while the
grand parent take all window (so even title and borders).

The Gtk parent of SpiceDisplay, at least used in remote-viewer
is a GtkBin created in virt-viewer.
So in the end we are changing a property of another Gtk
window. I don't know how this would work with spicy or other
users of this class. I think the reason of this is the way Gtk
handle the events basically taking all events from all windows
and dispatching with Gtk logic. This is different from classic
Windows programs where the dispatching is done by Windows itself.

Saying that calling ImmAssociateContext it's working and
it's much less intrusive I don't know if would be better to
have the call in remote-viewer too/instead.

Frediano


More information about the Spice-devel mailing list