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 [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.
Pierre Ossman [Tue, 31 Jul 2018 14:06:59 +0000 (16:06 +0200)]
Ignore buttons in mouse leave events
For KDE we can sometimes get a bunch of stray FL_LEAVE events before
gaining focus. Sending their included button information gets things
in the incorrect order with regard to other synchronisation we do on
focus. So just ignore buttons as the only information we want out of
the leave information is a position update.
Setting Ctrl or Alt key on menu only sends the key press, and the
state is lost when focus is lost and recovered.
This checks the menu variable and sends the keys again if needed.
Jan Grulich [Wed, 27 Jun 2018 11:13:46 +0000 (13:13 +0200)]
Avoid error/warning about implicit function declaration
Function xorgGlxCreateVendor() is defined in glx_extinit.h, if this header is
not included, we might get either error or warning. This header also need to
be included after scrninststr.h header as it defines some structures used
in glx_extinit.h
Pierre Ossman [Tue, 12 Jun 2018 13:58:34 +0000 (15:58 +0200)]
Ignore fake focus events from XGrabKeyboard()
Grabbing (and ungrabbing) the keyboard generates fake focus events
with modern versions of Xorg. This causes an infinite loop since we
update the grab status on focus events.
Michal Srb [Wed, 6 Jun 2018 11:33:37 +0000 (13:33 +0200)]
Add support for X server 1.20.0.
In-server GLVND requires xorgGlxCreateVendor call from InitOutput.
DPMS functions were moved to another location and no longer need to be faked.
xserver120.patch is a copy of xserver119.patch with refreshed contexts.
Pierre Ossman [Thu, 7 Jun 2018 07:16:02 +0000 (09:16 +0200)]
Properly sync LED state on connect
We should start by getting the remote end in sync with the actual
keyboard state. This would work randomly before depending on if we
got the first LED state message before or after we got focus.
Accept a cfg as an argument as an alt way to start the viewer
The user can specify a tigervnc configuration file as an argument to the
viewer. Previously the viewer assumed this to be a server, but now we
will first check if there is any file matching the given argument. If
so, try to load the content of that file, like we normally do.
Pierre Ossman [Mon, 7 May 2018 12:24:56 +0000 (14:24 +0200)]
Flush pending changes when desktop starts
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.