Hugo Lundin [Thu, 15 Jul 2021 10:52:56 +0000 (12:52 +0200)]
Add fullscreen mode parameter
Before this commit, `FullScreen` and `FullScreenAllMonitors` could be
used to configure whether to use the current monitor in fullscreen,
or all monitors in fullscreen.
This commit deprecates `FullScreenAllMonitors` in favour of
`FullScreenMode` (which can either be `current` or `all`). This allows
for additional modes to be added, without the risk of having invalid
states (for example two activate two different fullscreen modes at the
same time).
A new concept has been added; read-only parameters. They are parameters
that will be read, but never written back. This allows for migration
paths to be constructed, where a parameter can be taken to consideration
but then for example be discarded, logged or changed into something else.
This has been used for `FullScreenAllMonitors` to provide a migration
path. On startup of vncviewer, if `FullScreenAllMonitors` is enabled,
`FullScreenMode=all` will be automatically enabled instead. The next
time the configuration file is written to disk, `FullScreenAllMonitors`
will then be removed.
Hugo Lundin [Wed, 14 Jul 2021 12:55:56 +0000 (14:55 +0200)]
Calculate overlay position from window size
Previously, it was assumed that all monitors (and especially the primary
monitor, index 0) was inside the window when we calculate the position
of the overlay.
That might not always be the case, for example when using fullscreen
mode over a narrower set of monitors. This commit does so the overlay is
positioned correctly based on the actual window size, instead of what we
expect it to be.
Hugo Lundin [Fri, 16 Jul 2021 11:26:08 +0000 (13:26 +0200)]
Release displays not enclosed by the window
cocoa_capture_displays it captures all displays enclosed by the
window_rect. If a set of displays were captured, but the configuration of
what monitors to use changed, a second call would only add to the set
of captured displays. Therefore, if the user enabled
FullScreenAllMonitors (all displays captured) and then disabled it (only
one display captured) they would get into a state were monitors not used
for the VNC session still were captured (which on macOS for example,
results in displays being unusable for other things).
This has now been fixed, resulting in monitors outside the window_rect
not being unnecessarily captured.
Hugo Lundin [Tue, 13 Jul 2021 11:07:41 +0000 (13:07 +0200)]
Capture all displays inside the viewport (macOS)
It was only possible to capture either the current, or all displays
previously. This could become an issue if you want to show a vnc session
over only a selected set of displays, because then we only want to
capture those displays.
The solution in the commit was chosen because it handles all cases - by
looking at what monitors are enclosed by the viewport the implementation
is independent on any configuration, but instead captures the monitors
actually being used.
Pierre Ossman [Tue, 13 Jul 2021 10:42:56 +0000 (12:42 +0200)]
Remove vfb references from symbol names
Xvnc was originally based on Xvfb, but it's just confusing to keep the
names. So change all prefix to "vnc" instead to clearly mark things as
part of TigerVNC.
Pierre Ossman [Sun, 11 Jul 2021 18:59:48 +0000 (20:59 +0200)]
Handle X.org patch level features
With the 1.20.x releases there has been features and API changes even on
patch level versions, so we need to update our macros to handle these as
well.
Pierre Ossman [Thu, 17 Jun 2021 13:39:30 +0000 (15:39 +0200)]
Correctly handle screen layout with offset
We miscalculated the screen layout if the geometry had an offset as we
adjusted the real screen layout to account for the offset, but compared
it to the unadjusted geometry.
Pierre Ossman [Thu, 10 Jun 2021 14:32:29 +0000 (16:32 +0200)]
Remove early data check for TLSInStream
Having this early check means that we somewhat randomly get different
exception behaviours on errors in deeper layers as some exceptions are
allowed to propagate unhindered and some are not (since they are thrown
in the pull function).
Pierre Ossman [Mon, 7 Jun 2021 15:09:15 +0000 (17:09 +0200)]
Convert CI to GitHub Actions
Travis has unfortunately been severely rate limited by Docker Hub so we
have to switch to GitHub, which has an agreement with Docker to avoid
the rate limiting.
Jan Grulich [Tue, 25 May 2021 12:18:48 +0000 (14:18 +0200)]
CharArray: pre-fill empty array with zeroes
CharArray should always be null-terminated. There is a potential
scenario where this all might lead to crash. In Password we call
memset(), passing length of the array we get with strlen(), but
this won't return correct value when the array is not properly
null-terminated.
made full-screen edge scrolling smoother and faster
The old method used a very slow frame rate with small steps,
which made it obnoxious during use. The new method has a few
improvements:
- Calculates "edge" region width automatically, as a ratio of
the viewport size. Default is 1/16th.
- Uses a different edge width for x and y, which works better
on very wide or very tall screens.
- Increased default frame rate from 10 fps to 60 fps.
- Replaced hardcoded frame rate with a #define.
- Reduced maximum movement per frame slightly, because the
frame rate is so much faster. The overall result is still much
faster, but also easier to do small adjustments with.
- Fixed off-by-one error in scroll rate calculation formula. Left/up
scrolls were faster than down/right, but this is fixed.
This makes it more comfortable to use TigerVNC on a small screen
to work on a larger screen for hours at a time.
Pierre Ossman [Thu, 1 Nov 2018 09:19:15 +0000 (10:19 +0100)]
Maintain static screen DPI on resize
Trying to dynamically track the DPI did not really work as we'd
start accumulating errors and eventually the DPI would start to
drift. Instead maintain a fixed, sensible DPI at all times.
lhchavez [Mon, 8 Feb 2021 15:09:10 +0000 (07:09 -0800)]
Support the VMware Cursor Position extension on vncviewer
This change makes it possible for re-synchronizing the remote cursor on
the vncviewer when in fullscreen mode. This is done by locally moving
the cursor position to what the server thinks it should be.
lhchavez [Mon, 8 Feb 2021 00:36:47 +0000 (16:36 -0800)]
Add support for notifying clients about pointer movements
This change adds support for the VMware Mouse Position
pseudo-encoding[1], which is used to notify VNC clients when X11 clients
call `XWarpPointer()`[2]. This function is called by SDL (and other
similar libraries) when they detect that the server does not support
native relative motion, like some RFB clients.
With this, RFB clients can choose to adjust the local cursor position
under certain circumstances to match what the server has set. For
instance, if pointer lock has been enabled on the client's machine and
the cursor is not being drawn locally, the local position of the cursor
is irrelevant, so the RFB client can use what the server sends as the
canonical absolute position of the cursor. This ultimately enables the
possibility of games (especially FPS games) to behave how users expect
(if the clients implement the corresponding change).
Pierre Ossman [Thu, 14 Jan 2021 12:07:56 +0000 (13:07 +0100)]
Fix handling of bad update requests
We computed a safe area if a client gave us a bogus one, but we didn't
actually use it. Fix this properly and make sure we don't pass on bad
coordinates further.