Pierre Ossman [Fri, 30 Nov 2018 14:59:43 +0000 (15:59 +0100)]
Increase range of ComparingUpdateTracker statistics
32 bits are not enough to keep track of all the pixels that might
flow through the system. Expand things to 64 bits, which should cover
all reasonable uses.
Pierre Ossman [Mon, 26 Nov 2018 14:40:30 +0000 (15:40 +0100)]
Avoid using "fake" key codes
There is a range of key codes that are never sent by a real keyboard
and are therefore used by layouts to hide "fake" mappings. Make sure
to only use these as a fallback as some applications get confused
when they see these codes.
Pierre Ossman [Fri, 23 Nov 2018 16:48:02 +0000 (17:48 +0100)]
Abort unsafe lossless refresh early
We need to check earlier if we are going to send this refresh or
not. Otherwise we send out pings pointlessly, and we also stall
the request loop with a client as we clear the requested region
without actually sending an update message.
Prevent rendering uninitialized Pixmap contents on X11
The Pixmap is filled in as updates from the server arrive. Before the first full update, it would contain undefined contents, which would be rendered onto the ViewPort.
Clearing the Pixmap is only done on startup and when changing the server resolution, so it's not performance critical.
Pierre Ossman [Fri, 26 Oct 2018 13:54:56 +0000 (15:54 +0200)]
Get rid of SocketServer::checkTimeouts()
It doesn't belong on each socket server object as timers are global.
Force implementations to call the Timer system directly instead,
avoiding any middle men.
Pierre Ossman [Sat, 29 Sep 2018 09:24:19 +0000 (11:24 +0200)]
Properly terminate server on timeouts
Do a proper cleanup when one of the termination timeouts trigger
rather than just exiting on the spot. This makes sure we don't leave
stray stuff around, e.g. unix socket files.
Pierre Ossman [Fri, 26 Oct 2018 13:34:03 +0000 (15:34 +0200)]
Change exit timeouts to timers
This makes them more consistent with everything else, which makes
things clearer and also allows them to handle some corner cases
(e.g. only firing once).
Pierre Ossman [Tue, 6 Nov 2018 16:31:11 +0000 (17:31 +0100)]
Fixed handling of AltGr from Windows' touch keyboard
We need to test this always in order to catch Ctrl+AltGr, and to
handle release of the key properly. Hopefully there isn't any other
case where VK_MENU is sent without a scan code.
Pierre Ossman [Fri, 5 Oct 2018 15:48:58 +0000 (17:48 +0200)]
Inherit SocketServer directly from VNCServer
This makes VNCServer a sufficiently complete interface that callers
don't need to know about the specific implementation (VNCServerST
currently). And assuming that all servers will use sockets is not
that outrageous.
Pierre Ossman [Fri, 5 Oct 2018 15:35:51 +0000 (17:35 +0200)]
Encapsulate client handling in VNCServerST
Removed the last parts of VNCSConnectionST's back door in to
VNCServerST and let the parent class fully handle coordination of
clients, and access to the desktop.
Pierre Ossman [Thu, 25 Oct 2018 08:36:21 +0000 (10:36 +0200)]
Fix rendering on big endian system
Our XRender code assumes a certain pixel layout which was not
guaranteed on big endian systems. The previous workaround only worked
for some cases, so fix this properly now.
Pierre Ossman [Fri, 5 Oct 2018 15:30:52 +0000 (17:30 +0200)]
Encapsulate event handling in VNCServerST
There is some client coordination needed which is better encapsulated
inside VNCServerST. This also helps hiding the desktop from the
individual clients.
Pierre Ossman [Fri, 5 Oct 2018 14:59:22 +0000 (16:59 +0200)]
Force common flow of connection queries
Force queryConnection() to always call back to approveConnection()
rather than return special values. This makes the flow easier to
follow as it will be the same in all cases.
Pierre Ossman [Fri, 21 Sep 2018 13:33:30 +0000 (15:33 +0200)]
Delete TLS streams before deleting the session
The streams depend on the session and can crash the program if they
are removed in the wrong order. Do a general cleanup of the life time
management of the streams.
Pierre Ossman [Fri, 21 Sep 2018 10:30:54 +0000 (12:30 +0200)]
Replace Shift+Alt with Shift+Meta when possible
Most layouts on Unix generate Meta for Shift+Alt but non-Unix clients
will send XK_Alt_*. This results in us picking some other key which
can confuse some applications.
Try to detect this scenario and map XK_Alt_* to XK_Meta_*.
Pierre Ossman [Thu, 20 Sep 2018 14:35:37 +0000 (16:35 +0200)]
Estimate higher bandwidth in slow start
If we are still in slow start then we haven't discovered the actual
bandwidth limit yet. We also rely on the caller causing a bit of
congestion to detect the limit. So report a higher bandwidth estimate
than what we've currently tested in this scenario.
Pierre Ossman [Thu, 20 Sep 2018 08:52:15 +0000 (10:52 +0200)]
Allow perceptually lossless refresh
Loosen the definition of "lossless" a bit so that we can use high
quality JPEG to refresh damaged parts of the screen. Although this
isn't bit perfect, it is close enough that most users will not be
able to tell the difference.
Level 9 is used rather than level 8 because some monitors have
exaggerated contrast that allows the artefacts from level 8 to be
noticeable.
Pierre Ossman [Wed, 19 Sep 2018 14:35:40 +0000 (16:35 +0200)]
Limit maximum lossless refresh CPU usage
If we have plenty of bandwidth then CPU might be the limiting resource.
Unfortunately we don't have a good number for that limit, so add a
conservative hard coded value.
If an area recently changed then we can guess that it will most likely
change again very soon. In such a case it is meaningless to send a
lossless refresh as it will directly be overwritten. Keep track of
such areas and avoid refreshing them until we no longer see any
changes to them.
Pierre Ossman [Thu, 13 Sep 2018 10:31:59 +0000 (12:31 +0200)]
Stop tracking changes for each glyph
We get a whole bunch of very tiny areas, which is very inefficient to
deal with. Instead create a rectangle around every "list" of connected
glyphs (usually each line).
Pierre Ossman [Tue, 11 Sep 2018 12:22:04 +0000 (14:22 +0200)]
Explicitly check screen layout after change
There are some cases where the server state will not automatically
be updated on a change. A prominent one is when only RFB attributes
were changes (e.g. the screen ID) but nothing else. In that case
there is no actual change in the X server, so it never sends any
notification about change back to us.
Ensure queueMutex is always correctly released by using finally blocks. This is the closest approximation of AutoMutex style automatic release you can get in Java.