[Spice-devel] [spice-gtk] Ignore modifiers messages if no modifiers changed

Marc-André Lureau mlureau at redhat.com
Wed Sep 7 12:12:42 UTC 2016



----- Original Message -----
> > 
> > Hi
> > 
> > ----- Original Message -----
> > > This avoid keep sending modifiers changes if guest is not
> > > synchronising the changes.
> > > 
> > > I consider this as an improving as this avoids client to try again
> > > and again to force synchronisation however this does not prevent
> > > every unwanted keystroke insertion which possibly can be a real
> > > problem on some configurations.
> > > 
> > > For instance if guest do not handle caps lock as the client do
> > > if client uses another modifiers (as num lock) this can force
> > > inserting virtual caps keypress.
> > 
> > Is there a patch for the server side?
> > 
> 
> Started to write one but is conflicting with one from the refactory,
> I was thinking about waiting after the merge.
> 
> > 
> > > 
> > > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > > ---
> > >  src/channel-inputs.c | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/src/channel-inputs.c b/src/channel-inputs.c
> > > index 7572bff..f79bc38 100644
> > > --- a/src/channel-inputs.c
> > > +++ b/src/channel-inputs.c
> > > @@ -242,8 +242,10 @@ static void inputs_handle_modifiers(SpiceChannel
> > > *channel, SpiceMsgIn *in)
> > >      SpiceInputsChannelPrivate *c = SPICE_INPUTS_CHANNEL(channel)->priv;
> > >      SpiceMsgInputsKeyModifiers *modifiers = spice_msg_in_parsed(in);
> > >  
> > > -    c->modifiers = modifiers->modifiers;
> > > -    g_coroutine_signal_emit(channel, signals[SPICE_INPUTS_MODIFIERS],
> > > 0);
> > > +    if (c->modifiers != modifiers->modifiers) {
> > > +        c->modifiers = modifiers->modifiers;
> > > +        g_coroutine_signal_emit(channel,
> > > signals[SPICE_INPUTS_MODIFIERS],
> > > 0);
> > > +    }
> > >  }
> > 
> > looks good to me otherwise
> > 
> 
> Ack?

ack (hopefully I am not missing something)


More information about the Spice-devel mailing list