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

Christophe Fergeau cfergeau at redhat.com
Thu Jun 16 13:56:59 UTC 2016


On Wed, Jun 15, 2016 at 07:28:26AM -0400, Frediano Ziglio wrote:
> > 
> > Hi Frediano,
> > 
> > On Wed, 2016-06-15 at 11:54 +0100, Frediano Ziglio wrote:
> > > This prevent Windows to handle IME on the widget which cause the
> > > application to not receive keyboard events.
> > > 
> > > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > > ---
> > >  src/spice-widget.c | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > > 
> > > 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. */
> > 
> > Does it mean that events intended to be for the window but not for
> > SpiceDisplay
> > will be now forwarded to SpiceDisplay ? e.g.: navigation in menu items using
> > accelerators (alt+v to open the view menu)
> > 
> > Pavel
> > 
> 
> No means that Windows keyboard events were/are never sent to
> SpiceDisplay Windows' window (the "focus" is related to keyboard events).
> This patch does not change the events flow, just disable IME processing
> for the Windows window that handle keyboard events for SpiceDisplay.

Yeah, the patch looks good to me, less worrying that the previous
iterations. Better this way than having some magic GetParent()
assumption. And should be mostly robust to GTK+ changes (unless they
start doing something with IME too). However, it would be good to add to
the commit log exactly how to notice breakage without this patch (or was
this done in a previously committed patch already?)

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/20160616/83160e07/attachment.sig>


More information about the Spice-devel mailing list