The system to avoid processing changes for a stopped desktop was a
bit overly aggressive and resulted in those changes getting stuck even
when the desktop started again (yet another change was needed to get
things rolling again).
Make sure we flush out anything pending once the desktop is back up and
running. We don't use the frame timer here as we no longer know how
old these changes are, so we're not really rate limiting any application.
Comparing ScreenSet:s should be done without considering order
Avoids that a viewer connected to Xvnc sometimes disconnects with
"Desktop configured a different screen layout than requested" when
screens are changing.
We don't want to waste bandwidth on the lossless refresh if we might
need that bandwidth for a normal update. Try to estimate how much
data we can safely send without interfering.
Resend pixel perfect copies of areas that were previously sent
using a lossy encoder. This is done when there is no normal update
to send, and no congestion.
No need to run all the update machinery when there is no client
connected.
This commit also cleans up the stop handling a bit by moving it to
its own method.
We cannot send updates for a cursor that is outside the requested
region, so make sure we track things properly. This also has the nice
side effect of just re-sending the bits needed when the cursor overlaps
a changed part of the framebuffer.
Originally calling VNCServertST::setPixelBuffer(PixelBuffer* pb_) with pb_=0 would do nothing.
With this change pb will be set to 0 and deferred update timer will be stopped.
Simple shifting can give noticable rounding errors if there is a large
difference in the number of bits between the formats. Do the proper
thing via a lookup table, the same way things are done for up conversion.
We shouldn't unconditionally remove the server side cursor just
because the client supports client side cursors. We need to also
check that the client fulfills the other criteria for taking over
the cursor.
In most cases we will send an update at the end of processing client
messages so these extra calls only slow things down. Server initiated
events still need an explicit call though.
Improve the tracking of what cursor we've sent to the client to make
sure the initial cursor is sent properly. We previously tried to infer
this information based on if we've rendered a server side cursor or
not. This logic broke down if things triggered before we've sent the
first update to the client.
This makes it possible to create a derived class from Socket which is
not TCP based, without having VNCSConnectionST.cxx trying to call
setsockopt() on a non-socket.
Avoid corner case of applications rendering at frame rate
There is a problematic corner case where an application is updating
at exactly the same rate that we're sending update. In that case we
may miss updates regularly, getting a very uneven final frame rate.
Avoid this by introducing a slight offset when we start updating.
It was moved to the common code in f8e3b34c6, but it was unreliable
because the state could sometimes get out of sync. Push it back in
to Xvnc since it isn't necessarily something all servers will have.
This adds the basic infrastructure and handshake for the QEMU
Extended Key Events extension. No viewer or server makes use of
the extra functionality yet though.