Re: [gtk-vnc-devel] PATCH: key state tracking to avoid various bugs



Daniel P. Berrange wrote:
There are various problems with the VNC protocol and GTK relating to key
state tracking. The VNC protocol has no concept of modifier keys, nor a
way to reset key state. So if a client looses focus while one or more
keys are pressed down, the server will never see any 'release' event for
them. This is particularly troublesome with modifiers because it will appear that Ctlr or Alt is stuck down and you'll get really wierd behaviour
with keyboard shortcuts in your guest activating.

Second, GTK has the 'feature' where by it compresses  sequential press+release
events for the same key. So if you hold down the 'a' key long enough to get
keyboard repeat running, instead of down+up, down+up, down+up you'll merely
get down,down,down,...,down+up.  This seriously annoys some VNC servers,
in particular the Xen paravirt framebuffer will ignore the repeated down
events.
So this patch introduces  keystate tracking. This is then used in two cases
to send extra fake events. If we get two sequential down events for the same
key we will send an extra fake 'up' event before the extra down event. If
we get a focus-out event, we will send fake 'up' events for all currently held
down keys.  The state tracking also ensures that if the key is still held
when focusin occurs, we won't get duplicated 'up' events.

I posted a similar patch quite a while ago, and Anthony suggested trying to
hook into the mapping-notify event, but GTK doesn't expose this to apps,
and we need to track state anyway to work around the GTK key repeat insanity

Hi Dan,

I'm happy with this approach. I suspect this is the best way we can handle this. This has always been something that has annoyed me so I'm happy to see it fixed.

Thanks!

Regards,

Anthony Liguori

Regards,
Dan.
------------------------------------------------------------------------

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
------------------------------------------------------------------------

_______________________________________________
Gtk-vnc-devel mailing list
Gtk-vnc-devel lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtk-vnc-devel





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