Mark Mielke [Mon, 20 Feb 2023 05:38:52 +0000 (00:38 -0500)]
VNCSConnectionST clipboard functions should check state before access.
Clipboard functions may run on connections that are not yet at
RFBSTATE_NORMAL. Due to recent hardening of the accessCheck() function,
it is important to validate that the state is RFBSTATE_NORMAL before
calling accessCheck().
Pierre Ossman [Tue, 28 Feb 2023 15:00:15 +0000 (16:00 +0100)]
Throw exception instead on bad access check
An assert will kill the entire server, which is overly harsh when there
is a problem with a single connection. Instead, throw an exception which
will just disconnect that specific client.
Pierre Ossman [Tue, 14 Dec 2021 16:06:36 +0000 (17:06 +0100)]
Handle macOS keyboard stealing
The system steals keyboard events for certain system keyboard shortcuts,
e.g. Cmd+Tab. Unfortunately this isn't considered a focus loss, so we
don't realise we've lost a few keyboard events and can end up in a
confused state.
Fortunately it is possible to detect when this happens and reset the
keyboard state, just like we do when focus is lost.
Pierre Ossman [Mon, 12 Dec 2022 14:25:51 +0000 (15:25 +0100)]
Don't start sessions until there are users
Delay startup of VNC sessions until user databases are up and running.
This is the same ordering that GDM imposes to make sure users can
actually log in.
Jan Grulich [Tue, 9 Aug 2022 12:31:07 +0000 (14:31 +0200)]
x0vncserver: add new keysym in case we don't find a matching keycode
We might often fail to find a matching X11 keycode when the client has
a different keyboard layout and end up with no key event. To avoid a
failure we add it as a new keysym/keycode pair so the next time a keysym
from the client that is unknown to the server is send, we will find a
match and proceed with key event. This is same behavior used in Xvnc or
x11vnc, although Xvnc has more advanced mapping from keysym to keycode.
Pierre Ossman [Mon, 7 Nov 2022 12:45:34 +0000 (13:45 +0100)]
Flush decoder errors on close()
We don't want any stray exceptions as we are cleaning up, so handle any
still pending decoder errors by just logging them. We are already
shutting down so there is no need to abort the connection here.
Pierre Ossman [Wed, 24 Aug 2022 08:31:42 +0000 (10:31 +0200)]
Use BufferedOutStream in more streams
Avoid duplicating all the memory mangement, and instead use the
BufferedOutStream as a base clase for all out streams that need an
intermediate buffer.
Jan Grulich [Thu, 11 Aug 2022 11:15:29 +0000 (13:15 +0200)]
x0vncserver: update/display cursor only on correct screen in zaphod mode
We have to check whether we update cursor position/shape only in case
the cursor is on our display, otherwise in zaphod mode, ie. when having
two instances of x0vncserver on screens :0.0 and :0.1 we would be having
the cursor duplicated and actually not funcional (aka ghost cursor) as
it would be actually not present. We also additionally watch EnterNotify
and LeaveNotify events in order to show/hide cursor accordingly.
Change made with help from Olivier Fourdan <ofourdan@redhat.com>
This commit changes the color of the edges of the dot cursor in the Java
version of vncviewer from fully transparent to white, bringing it in
line with the C++ native version.
Pierre Ossman [Mon, 4 Jul 2022 12:42:55 +0000 (14:42 +0200)]
Store artifacts from Github actions
Might be useful for testing in some cases. Note that the Windows and
Linux binaries will depend on libraries from the build environment. So
the user will need to match those manually.
Pierre Ossman [Tue, 5 Jul 2022 07:19:07 +0000 (09:19 +0200)]
Fix Xvnc dependency list (again)
The previous commit was incorrect in that it overrides automake's
dependency list, rather than adding to it. So we need to make sure
things are duplicated between Xvnc_DEPENDENCIES and Xvnc_LDADD as
appropriate.
Use the same approach as the Xorg binary to keep things familiar.
Pierre Ossman [Mon, 4 Jul 2022 11:59:42 +0000 (13:59 +0200)]
Add missing dependencies for Xvnc
These aren't crucial for a clean build, but must be set for Xvnc to be
properly rebuilt if anything in the Xorg tree changes. automake doesn't
properly deduce these automatically from Xvnc_LDADD, unfortunately.
Pierre Ossman [Tue, 28 Jun 2022 12:49:40 +0000 (14:49 +0200)]
Safely discard large (extended) clipboard contents
Avoid having to buffer everything we want to discard, and instead do it
piece by piece. This is more efficient, and avoids hitting any limits on
the buffering.
Note that this is safe here because we already know we have all the
compressed data. It would not be safe for a general input stream.
Pierre Ossman [Tue, 28 Jun 2022 12:47:39 +0000 (14:47 +0200)]
Properly restore cork state when changed
These streams both need to change the corking state temporarily, but it
is important it is restored to the previous state or things might get
messed up.
For the zlib stream it would just leave things uncorked, which still
works but is less efficient.
But for the TLS stream it might make things very unresponsive as the
corking might be left on permanently, delaying packets indefinitely.
Martins Mozeiko [Tue, 7 Jun 2022 07:37:54 +0000 (00:37 -0700)]
Workaround for MFT cropping in H264 decoding
It seems MFT h264 decoder does not support frame cropping. Which
means that if frame width or height is not multiple of 16 then
decoded output can potentially be used with wrong offset. This
code adds explicit parsing of SPS to extract cropping information
to use, and will apply cropping if reported size differs from
expected.
Pierre Ossman [Sat, 4 Jun 2022 12:19:07 +0000 (14:19 +0200)]
Add target_link_directory() compat function
We need this function to deal with pkgconfig files properly, but
unfortunately it doesn't exist until CMake 3.13, and we need to support
CMake 3.10. So add a hacky compatibility function for older systems.