Pierre Ossman [Mon, 29 Oct 2018 09:03:37 +0000 (10:03 +0100)]
Require all SMsgWriter caller to check capabilities
Make the API consisitent by requiring the caller to check what the client
supports before calling any of the write* functions. This avoids the
confusion that the functions might not always do anything.
Pierre Ossman [Mon, 10 Dec 2018 19:16:12 +0000 (20:16 +0100)]
Always send current screen layout to client
This is what the protocol requires, rather than sending what the
client specified in the request. This should be the same in practice
except for failures and possibly some races.
Pierre Ossman [Wed, 20 Jun 2018 14:03:23 +0000 (16:03 +0200)]
Move client attributes out of ServerParams
ServerParams should contain the server state and not information about
client settings or capabilities. Move those things up a level to the
CConnection object.
Pierre Ossman [Wed, 20 Jun 2018 13:47:49 +0000 (15:47 +0200)]
Merge client resize capabilities
No need to have one setting for each extension. All the client code
needs to indicate is if it supports resize. The common code can then
map this to relevant extensions.
Pierre Ossman [Wed, 20 Jun 2018 09:35:05 +0000 (11:35 +0200)]
Make arguments explicit in all message writer methods
Make sure all methods only write what is given as arguments, and
avoid side effects by getting data from parameter objects. This keeps
things readable in the calling code.
Pierre Ossman [Wed, 31 Oct 2018 16:08:59 +0000 (17:08 +0100)]
Let CMsgHandler::serverInit() handle initial set up
Avoid using the callbacks used for runtime changes for the initial
setup. They weren't really useful anyway as you could not allocate
a framebuffer without also knowing the pixel format. So make things
more clear by letting serverInit() get the initial settings.
Pierre Ossman [Wed, 20 Jun 2018 10:25:14 +0000 (12:25 +0200)]
Encapsulate screen layout storage in ConnParams
Avoid direct access to the screen dimensions and layout so that we
can make sure it stays sane. This also makes sure the layout is
properly updated when we only get the screen dimensions from the
server.
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, 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.