]> source.dussan.org Git - tigervnc.git/log
tigervnc.git
3 months agoEnforce not shadowing variables 1774/head
Pierre Ossman [Sat, 20 Apr 2024 08:53:18 +0000 (10:53 +0200)]
Enforce not shadowing variables

Shadowing variable can easily lead to bugs, so let's enforce that this
is not allowed.

3 months agoAvoid shadowing variables
Pierre Ossman [Sun, 21 Apr 2024 00:18:22 +0000 (02:18 +0200)]
Avoid shadowing variables

It's a source of confusion and possibly bugs to reuse the same variable
name for multiple things.

3 months agoUse "static" for helper functions
Pierre Ossman [Sun, 21 Apr 2024 00:23:46 +0000 (02:23 +0200)]
Use "static" for helper functions

These functions act only on the input parameters, so let's make them
static to more clearly indicate that they do not act upon any object.

3 months agoSimplify RandR output name handling
Pierre Ossman [Sun, 21 Apr 2024 00:22:38 +0000 (02:22 +0200)]
Simplify RandR output name handling

Store the name in a std::string to make things less complex as we don't
need to be as careful about making sure the data is free():d.

3 months agoAvoid redundant arguments
Pierre Ossman [Sun, 21 Apr 2024 00:20:32 +0000 (02:20 +0200)]
Avoid redundant arguments

Remove redundant arguments where the method already has access to the
relevant variable as an object attribute.

3 months agoSimplify code using range-based for loops
Pierre Ossman [Wed, 3 Apr 2024 20:05:49 +0000 (22:05 +0200)]
Simplify code using range-based for loops

These are often more readable as they avoid a lot of the boilerplate of
iterating over fixed arrays or STL containers.

Note that this change is very conservative to avoid noise in "git
blame". Only loops where this is a clear improvement have been
converted.

3 months agoRemove careful client iteratation
Pierre Ossman [Fri, 19 Apr 2024 21:48:37 +0000 (23:48 +0200)]
Remove careful client iteratation

Clients cannot remove themselves from the list as we are iterating, so
we don't need this complexity. If a client encounters a problem, it will
only mark it self as closed and will be removed from the list at a later
time.

3 months agoPrefer std::find() over manual search
Pierre Ossman [Fri, 19 Apr 2024 21:39:47 +0000 (23:39 +0200)]
Prefer std::find() over manual search

Let's avoid reimplementing something basic that's available in the
standard library. It also makes the code easier to read.

3 months agoRemove unnecessary headers from Security.cxx
Pierre Ossman [Wed, 3 Apr 2024 16:49:24 +0000 (18:49 +0200)]
Remove unnecessary headers from Security.cxx

3 months agoEnforce using "override"
Pierre Ossman [Wed, 3 Apr 2024 16:44:33 +0000 (18:44 +0200)]
Enforce using "override"

Make sure developers don't miss marking methods correctly.

3 months agoMark overridden virtual functions
Pierre Ossman [Wed, 3 Apr 2024 15:26:03 +0000 (17:26 +0200)]
Mark overridden virtual functions

Use the new "override" keyword to properly differentiate between new
virtual methods, and existing virtual methods being overridden.

3 months agoEnforce using nullptr for C++ code
Pierre Ossman [Wed, 3 Apr 2024 10:42:43 +0000 (12:42 +0200)]
Enforce using nullptr for C++ code

The compiler can help out in making sure we are consistent in our use of
nullptr rather than NULL.

3 months agoDisable gcc NULL warning for context menu
Pierre Ossman [Wed, 3 Apr 2024 10:38:04 +0000 (12:38 +0200)]
Disable gcc NULL warning for context menu

We use the pointer to just store an identifier for the menu, but this is
enough for gcc to think we are using 0 instead of nullptr and complain.
Even an explicit cast isn't enough to silence it here for some reason.

3 months agoUse nullptr in all C++ code
Pierre Ossman [Tue, 2 Apr 2024 14:13:23 +0000 (16:13 +0200)]
Use nullptr in all C++ code

It's more readable than 0, and a bit safer than NULL, so let's try to
follow modern norms.

3 months agoMake sure we use C++ 11
Pierre Ossman [Tue, 2 Apr 2024 14:06:10 +0000 (16:06 +0200)]
Make sure we use C++ 11

It's rare we use a compiler that has anything older as a default, but it
does happen sometimes. So make sure to guarantee this so we can start
using more modern constructs.

3 months agoFix Windows installer dependencies
Pierre Ossman [Sun, 21 Apr 2024 00:21:42 +0000 (02:21 +0200)]
Fix Windows installer dependencies

Make sure the dependencies point to the correct files, even if an out of
tree build is used.

3 months agoMerge pull request #1767 from bphinz/ubuntu-noble
Brian Hinz [Wed, 19 Jun 2024 15:31:58 +0000 (11:31 -0400)]
Merge pull request #1767 from bphinz/ubuntu-noble

Updates for package builds

3 months agoRemove support for EoL operating systems 1767/head
Brian P. Hinz [Wed, 19 Jun 2024 15:18:09 +0000 (11:18 -0400)]
Remove support for EoL operating systems

3 months agoMerge branch 'xserver-cleanup' of github.com:CendioOssman/tigervnc
Pierre Ossman [Wed, 19 Jun 2024 14:58:47 +0000 (16:58 +0200)]
Merge branch 'xserver-cleanup' of github.com:CendioOssman/tigervnc

3 months agoRemove old Xorg configure arguments 1770/head
Pierre Ossman [Fri, 22 Mar 2024 12:07:26 +0000 (13:07 +0100)]
Remove old Xorg configure arguments

These are no longer used in the versions of Xorg currently in use.

3 months agoRaise Xorg requirement to 1.20+
Pierre Ossman [Thu, 21 Mar 2024 15:18:46 +0000 (16:18 +0100)]
Raise Xorg requirement to 1.20+

No current distribution uses anything older, so let's make things easier
for us to maintain.

3 months agoRemove Ubuntu 18.04 packaging
Pierre Ossman [Fri, 22 Mar 2024 08:37:43 +0000 (09:37 +0100)]
Remove Ubuntu 18.04 packaging

Ubuntu 18.04 has been EOL for almost a year, so remove those packages so
we can ease our maintenance burden.

3 months agoAvoid patching miinitext.c for Xvnc
Pierre Ossman [Tue, 20 Feb 2024 16:23:56 +0000 (17:23 +0100)]
Avoid patching miinitext.c for Xvnc

Things do not need to be this complicated. We can make sure the VNC
extension is always included in a much cleaner way, at least since Xorg
1.16.

3 months agoMerge branch 'present' of github.com:CendioOssman/tigervnc
Pierre Ossman [Wed, 19 Jun 2024 14:45:12 +0000 (16:45 +0200)]
Merge branch 'present' of github.com:CendioOssman/tigervnc

3 months agoStop explicitly including fbcmap_mi.c
Pierre Ossman [Tue, 20 Feb 2024 16:03:07 +0000 (17:03 +0100)]
Stop explicitly including fbcmap_mi.c

This hasn't been needed since Xorg 1.16.

3 months agoSlow down fake clock when no clients 1769/head
Pierre Ossman [Mon, 19 Feb 2024 14:28:12 +0000 (15:28 +0100)]
Slow down fake clock when no clients

Run the frame clock at a slow 1 Hz if there are no clients connected.
This is similar to what a normal X server does when the screen is
blanked, and should keep applications waiting for the frame tick happy.

Note that we still only keep the frame clock running if there is any
application that are interested in it. Otherwise we still stop it
completely.

3 months agoStop linking to libX11
Pierre Ossman [Tue, 20 Feb 2024 16:00:20 +0000 (17:00 +0100)]
Stop linking to libX11

Unclear why this was ever needed. libX11 is for X11 clients, and we're
building a server.

3 months agoKeep frame clock running if waiting for frame tick
Pierre Ossman [Wed, 28 Feb 2024 13:20:54 +0000 (14:20 +0100)]
Keep frame clock running if waiting for frame tick

If there is something interested in synchronizing to a frame tick, then
keep the frame clock running, even if there are no updates.

This is need mainly when something starts rendering, but also when
something renders much slower than the frame clock (so it is essentially
constantly "starting"). Such an application will not draw anything until
it gets a new frame tick, which it won't get as the frame clock is
waiting for something to start drawing.

3 months agoClean up CPPFLAGS handling in xserver
Pierre Ossman [Tue, 20 Feb 2024 16:00:05 +0000 (17:00 +0100)]
Clean up CPPFLAGS handling in xserver

Make things a bit easier to maintain. This style is also more in line
with what is being done for other DDX.

3 months agoRestart the frame timer immediately
Pierre Ossman [Thu, 29 Feb 2024 16:33:43 +0000 (17:33 +0100)]
Restart the frame timer immediately

This marks the timer as started again, before we call out to various
external places that might be confused by the frame timer reporting that
it is stopped.

3 months agoRemove unused NO_MODULE_EXTS define
Pierre Ossman [Tue, 20 Feb 2024 12:09:08 +0000 (13:09 +0100)]
Remove unused NO_MODULE_EXTS define

This has never actually been used, as far as I can tell.

3 months agoAdd support for X Present extension
Pierre Ossman [Fri, 16 Feb 2024 13:31:54 +0000 (14:31 +0100)]
Add support for X Present extension

This makes it possible for applications to synchronize their updates to
the updates sent out to clients. This avoids tearing, and could in the
future also help with rate limiting applications to what the client can
actually show.

3 months agoActually use config.h in Xvnc/libvnc.so
Pierre Ossman [Tue, 20 Feb 2024 12:03:55 +0000 (13:03 +0100)]
Actually use config.h in Xvnc/libvnc.so

Rather than disabling this, make sure the build can find the relevant
file.

3 months agoAdd missing ErrorF() newlines
Pierre Ossman [Fri, 16 Feb 2024 13:31:29 +0000 (14:31 +0100)]
Add missing ErrorF() newlines

3 months agoSimplify Xorg version handling
Pierre Ossman [Tue, 20 Feb 2024 11:59:25 +0000 (12:59 +0100)]
Simplify Xorg version handling

VENDOR_RELEASE has been available as a #define since Xorg 1.7, so let's
use that and remove all of our custom magic.

3 months agoMake SDesktop::start()/stop() optional
Pierre Ossman [Wed, 28 Feb 2024 13:02:20 +0000 (14:02 +0100)]
Make SDesktop::start()/stop() optional

Let's avoid requring these as a desktop implementation can now set up
everything in the init() method.

3 months agoMaintain a constant VNCServer/SDesktop connection
Pierre Ossman [Wed, 28 Feb 2024 12:54:23 +0000 (13:54 +0100)]
Maintain a constant VNCServer/SDesktop connection

The desktop isn't completely paused just because there are no clients,
so it might still need some support from the server object.

This is primarily an issue for headless servers, where they need to
continue emulating things even without clients. A scraping server can
generally go completely passive if there are no clients.

3 months agoMake it easier to change timer interval
Pierre Ossman [Thu, 29 Feb 2024 15:01:48 +0000 (16:01 +0100)]
Make it easier to change timer interval

3 months agoExplicitly request timer repetition
Pierre Ossman [Fri, 18 Nov 2022 15:31:41 +0000 (16:31 +0100)]
Explicitly request timer repetition

One-shot timers are more common, so let's change the API a bit to make
that use case simpler. This API also makes it more clear what is
happening.

3 months agoFix up Timer comments
Pierre Ossman [Fri, 18 Nov 2022 10:20:57 +0000 (11:20 +0100)]
Fix up Timer comments

They were badly formatted, way longer than the normal 72 columns.

3 months agoAdd safety check to getNextTimeout()
Pierre Ossman [Tue, 3 Jan 2023 08:27:46 +0000 (09:27 +0100)]
Add safety check to getNextTimeout()

It currently won't ever be called with an empty list of timers, but it
is a public function so that might happen in the future. Make sure this
case is handled without crashes.

3 months agoStop treating "0" as "no timeouts"
Pierre Ossman [Tue, 3 Jan 2023 08:24:51 +0000 (09:24 +0100)]
Stop treating "0" as "no timeouts"

It is much more sane to treat "0" as "a timer is ready NOW", so let's
change to using -1 as the invalid timeout value.

3 months agoRemove unneeded iteration
Pierre Ossman [Tue, 3 Jan 2023 08:20:45 +0000 (09:20 +0100)]
Remove unneeded iteration

This should have been done in a4308c9.

3 months agoDetect conflicting timer rescheduling
Pierre Ossman [Thu, 29 Feb 2024 08:23:01 +0000 (09:23 +0100)]
Detect conflicting timer rescheduling

Repeating a timer can be done in two ways:

 * Returning true from the handler
 * Calling start() again in the handler

The latter is useful if you want to change the timer interval.

If both are used, then it becomes ambiguous when the timer should fire
again.

Detect this case and warn about it. Current implementation will respect
the new interval given to start(), rather than the interval set before
running the handler.

3 months agoUbuntu packaging updates
Brian P. Hinz [Wed, 19 Jun 2024 00:09:19 +0000 (20:09 -0400)]
Ubuntu packaging updates

4 months agoAdd support for PKCS11 jar signing
Brian P. Hinz [Sat, 15 Jun 2024 20:55:27 +0000 (16:55 -0400)]
Add support for PKCS11 jar signing

4 months agoMerge branch 'pam_env' of github.com:CendioOssman/tigervnc
Pierre Ossman [Thu, 30 May 2024 14:41:29 +0000 (16:41 +0200)]
Merge branch 'pam_env' of github.com:CendioOssman/tigervnc

4 months agoCreate common recursive mkdir() 1760/head
Pierre Ossman [Thu, 30 May 2024 14:05:35 +0000 (16:05 +0200)]
Create common recursive mkdir()

Avoid duplicating this complexity in too many places.

At the same time make the interface more identical to regular mkdir(),
for familiarity.

4 months agoUse $XDG_STATE_HOME for known hosts storage
Pierre Ossman [Thu, 30 May 2024 13:37:27 +0000 (15:37 +0200)]
Use $XDG_STATE_HOME for known hosts storage

This is an often changed database, so it is better suited for
$XDG_STATE_HOME rather than the more static $XDG_DATA_HOME.

4 months agoOnly do restorecon() for legacy directory
Pierre Ossman [Thu, 30 May 2024 13:31:50 +0000 (15:31 +0200)]
Only do restorecon() for legacy directory

This is only needed because of an historical type change of the legacy
directory, so avoid doing it anywhere else.

4 months agoFix late vncsession logging
Pierre Ossman [Wed, 22 May 2024 09:44:41 +0000 (11:44 +0200)]
Fix late vncsession logging

The syslog file descriptor will be closed when we are cleaning up in
preparation for running the vncserver script, so we need to explicitly
reopen things in case we need to log errors.

At the same time, try to be polite and explicitly close the log when
appropriate.

4 months agoRespect PAM modules for $XDG_STATE_HOME
Pierre Ossman [Mon, 20 May 2024 15:34:51 +0000 (17:34 +0200)]
Respect PAM modules for $XDG_STATE_HOME

E.g. pam_env.so might modify this variable, so we should see what we get
out of PAM when building a log file path.

4 months agoAdd comment that PAM configuration is an example
Pierre Ossman [Mon, 20 May 2024 15:32:57 +0000 (17:32 +0200)]
Add comment that PAM configuration is an example

There is too much variation between distributions for us to have a good
PAM configuration that works everywhere. Try to make this more obvious
by having a comment at the top of the file.

4 months agoMerge branch 'casantos-rhbz_2180903' of https://github.com/casantos/tigervnc
Pierre Ossman [Mon, 20 May 2024 14:12:12 +0000 (16:12 +0200)]
Merge branch 'casantos-rhbz_2180903' of https://github.com/casantos/tigervnc

4 months agoDon't check pointers for zero length buffers
Pierre Ossman [Mon, 20 May 2024 08:44:41 +0000 (10:44 +0200)]
Don't check pointers for zero length buffers

It's perfectly fine to give a NULL pointer if the length has explicitly
been specified as zero.

5 months agoMerge pull request #1737 from 62832/fix-1195
Samuel Mannehed (ThinLinc team) [Tue, 7 May 2024 13:00:43 +0000 (15:00 +0200)]
Merge pull request #1737 from 62832/fix-1195

Allow for alternative user config locations, deprecate `~/.vnc` in favour of XDG Base Directory Specification paths

5 months agoImplement XDG Base Directory paths, deprecate ~/.vnc 1737/head
90 [Fri, 26 Apr 2024 15:22:03 +0000 (16:22 +0100)]
Implement XDG Base Directory paths, deprecate ~/.vnc

5 months agovncconfig: add option to force view-only remote client connections 1670/head
Carlos Santos [Wed, 29 Nov 2023 21:52:52 +0000 (18:52 -0300)]
vncconfig: add option to force view-only remote client connections

Specifies that the server must ignore all keyboard or mouse events sent
by the client.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2180903
Signed-off-by: Carlos Santos <casantos@redhat.com>
5 months agoRemove the network::SocketServer interface.
Carlos Santos [Tue, 9 Jan 2024 13:32:20 +0000 (10:32 -0300)]
Remove the network::SocketServer interface.

Move these RFB specific things to rfb::VNCServer, for clarity.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
Signed-off-by: Carlos Santos <casantos@redhat.com>
5 months agoAdd .gitignore for SELinux files
Pierre Ossman [Fri, 26 Apr 2024 12:53:00 +0000 (14:53 +0200)]
Add .gitignore for SELinux files

5 months agoDon't trigger build from install target
Pierre Ossman [Fri, 26 Apr 2024 12:52:11 +0000 (14:52 +0200)]
Don't trigger build from install target

The norm is that the install target is read only from the point of view
of the source and build directory, so avoid accidentally triggering any
build.

5 months agoClean up temporary SELinux directory
Pierre Ossman [Fri, 26 Apr 2024 12:51:46 +0000 (14:51 +0200)]
Clean up temporary SELinux directory

5 months agoOverwrite vncsession.pp.bz2 each time
Pierre Ossman [Fri, 26 Apr 2024 12:51:06 +0000 (14:51 +0200)]
Overwrite vncsession.pp.bz2 each time

Make it easier to work iteratively by not having to remove the output
file each time.

5 months agoMove the AccessRights type and constants to the rfb namespace
Carlos Santos [Tue, 28 Nov 2023 21:11:13 +0000 (18:11 -0300)]
Move the AccessRights type and constants to the rfb namespace

They must belong to the rfb namespace, not to the SConnection class.

Also add an AccessNone constant, since it's better to use a mnemonic
symbol rather than zero to initialize the accessRights members.

Signed-off-by: Carlos Santos <casantos@redhat.com>
6 months agoUse XQueryPointer() instead to detect zaphod
Pierre Ossman [Wed, 10 Apr 2024 10:37:45 +0000 (12:37 +0200)]
Use XQueryPointer() instead to detect zaphod

FLTK can send events with fl_xevent pointing to random memory, which
means that we cannot trust that structure. XQueryPointer() can give us
what we need, at the cost of an extra round trip.

6 months agoCorrectly set socket write notification
Pierre Ossman [Tue, 9 Apr 2024 10:54:22 +0000 (12:54 +0200)]
Correctly set socket write notification

That extra add_fd() only set the read notification, overwriting any
write notification set up in the lines just above.

6 months agoUpdate github actions to latest versions
Pierre Ossman [Tue, 2 Apr 2024 12:13:46 +0000 (14:13 +0200)]
Update github actions to latest versions

Primarily to avoid the versions that are now deprecated.

6 months agoMerge pull request #1742 from TigerVNC/issue843
Brian Hinz [Sat, 30 Mar 2024 20:06:04 +0000 (16:06 -0400)]
Merge pull request #1742 from TigerVNC/issue843

Fix for issue 843

6 months agoFix for issue 843 1742/head
Brian P. Hinz [Sat, 30 Mar 2024 19:51:34 +0000 (15:51 -0400)]
Fix for issue 843

7 months agoBegin work on XDGBDS compliance and overrideable configs
90 [Fri, 15 Mar 2024 22:00:17 +0000 (22:00 +0000)]
Begin work on XDGBDS compliance and overrideable configs

7 months agoDon't link gcrypt for static GnuTLS
Pierre Ossman [Fri, 15 Mar 2024 11:47:34 +0000 (12:47 +0100)]
Don't link gcrypt for static GnuTLS

GnuTLS seems to have dropped grypt support ages ago, so let's not
confuse things by assuming it might be needed when linking GnuTLS
statically.

7 months agoProperly propagate CursorWarpedTo()
Pierre Ossman [Sat, 24 Feb 2024 13:09:14 +0000 (14:09 +0100)]
Properly propagate CursorWarpedTo()

Although unlikely, there might be other parts of the X server that are
also interested in this call. Make sure we propagate things on properly.

8 months agoClarify AcceptPointerEvents setting
Pierre Ossman [Tue, 6 Feb 2024 15:53:36 +0000 (16:53 +0100)]
Clarify AcceptPointerEvents setting

It doesn't just control button events, but all types of pointer events,
including movement.

8 months agoFix shared memory leak 1722/head
Adam Halim [Mon, 12 Jun 2023 08:44:43 +0000 (10:44 +0200)]
Fix shared memory leak

The MIT-SHM documentation:
  https://www.x.org/releases/X11R7.7/doc/xextproto/shm.html
says to run XShmDetach() first, and then to destroy the segment.

(cherry picked from commit 585ee24d4cd81759ca7206d5d5181a491c2e8898)

8 months agoIncrease time required to override pointerClient
Samuel Mannehed [Fri, 26 Jan 2024 12:49:04 +0000 (13:49 +0100)]
Increase time required to override pointerClient

Mouse events in shared connections are locked to one viewer at a time.
If the a mouse drag is happening in the first viewer, the second viewer
can't interfere unless the first viewer has been inactive for a set
amount of time. This timeout was put in place in
71c83b479335337b25dc331d3fb4a6e29382ceb5 to handle the case where the
first viewer disconnects while the mouse drag is happening. Prior to the
timeout, this resulted in all input being blocked.

This commit increases this timeout from 3 seconds to 10 seconds. This is
to minimize the risk of this happening during "normal" use. With this
change, the first viewer has to be inactive for 10 seconds before the
second viewer can take control again.

In the case where the first viewer disconnects, a waiting time of 10
seconds for the second viewer seems very reasonable.

8 months agoBreak long lines in new pointerEvent logic
Samuel Mannehed [Fri, 26 Jan 2024 12:19:31 +0000 (13:19 +0100)]
Break long lines in new pointerEvent logic

8 months agoFix bad variable reference in file logger
Pierre Ossman [Thu, 25 Jan 2024 15:18:43 +0000 (16:18 +0100)]
Fix bad variable reference in file logger

8 months agoMerge pull request #1718 from MikeLooijmans/server-mousebuttonowner-timeout
linma (ThinLinc team) [Thu, 25 Jan 2024 13:29:00 +0000 (14:29 +0100)]
Merge pull request #1718 from MikeLooijmans/server-mousebuttonowner-timeout

VNCServerST: Add a timeout to pointer button ownership

8 months agoSet all HAVE_ macros on the top level
Pierre Ossman [Wed, 24 Jan 2024 10:10:58 +0000 (11:10 +0100)]
Set all HAVE_ macros on the top level

This keep everything consistent.

8 months agoRemove superfluous X11_FOUND check
Pierre Ossman [Wed, 24 Jan 2024 10:10:07 +0000 (11:10 +0100)]
Remove superfluous X11_FOUND check

It is REQUIRED in this context, so we can assume X11 has been found.

8 months agoMerge branch 'systemd' of https://github.com/CendioOssman/tigervnc
Pierre Ossman [Wed, 24 Jan 2024 09:27:50 +0000 (10:27 +0100)]
Merge branch 'systemd' of https://github.com/CendioOssman/tigervnc

8 months agoDocument optional libsystemd requirement
Pierre Ossman [Wed, 24 Jan 2024 09:21:18 +0000 (10:21 +0100)]
Document optional libsystemd requirement

8 months agoAllow combining socket activation and extra ports
Pierre Ossman [Wed, 24 Jan 2024 08:43:02 +0000 (09:43 +0100)]
Allow combining socket activation and extra ports

The common use case is probably to only listem to the systemd provided
socket when using socket activation, but it might not be the only use
case. Make sure things can be combined if explicitly requested.

8 months agoLog when sd_listen_fds() fails
Pierre Ossman [Wed, 24 Jan 2024 08:41:32 +0000 (09:41 +0100)]
Log when sd_listen_fds() fails

8 months agoUse SD_LISTEN_FDS_START constant
Pierre Ossman [Wed, 24 Jan 2024 08:25:35 +0000 (09:25 +0100)]
Use SD_LISTEN_FDS_START constant

Avoid magical numbers as it makes it hard to understand the code.

8 months agoMake systemd detection more robust
Pierre Ossman [Wed, 24 Jan 2024 08:07:57 +0000 (09:07 +0100)]
Make systemd detection more robust

We don't need to look for this on Windows or macOS, and we need to be
able to gracefully handle systems without pkg-config.

8 months agoVNCServerST: Add a timeout to pointer button ownership 1718/head
Mike Looijmans [Tue, 16 Jan 2024 15:27:43 +0000 (16:27 +0100)]
VNCServerST: Add a timeout to pointer button ownership

When one clients holds down a button on the pointer device (probably
dragging something), other clients' attempts at pointer operations
are denied. This yields a sane user experience, but with limits.

When one clients starts dragging, and then his network connection fails,
other clients are denied access to the pointer until the VNC server
finally discovers that the connection is dead and closes it. This can
take about 15 minutes.

Add a timeout to this policy: If we don't hear from the client for 3
seconds, other clients are allowed to control the pointer once more.

This solves the problem that one failing network could make the server
completely deaf to other clients for a long time.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
9 months agoVNCSConnectionST: Release mouse button(s) on close 1717/head
Mike Looijmans [Thu, 11 Jan 2024 10:16:27 +0000 (11:16 +0100)]
VNCSConnectionST: Release mouse button(s) on close

When the connection is severed, release all mouse buttons.

This fixes an issue with x0vncserver where the local display
would stop responding to mouse events if the connection closes
while the remote user was holding down a mouse button.

To reproduce, start a VNC client, press and hold a mouse button
and then kill the connection (e.g. close client, kill server,
yank network cable). This caused the local screen to no longer
respond to any mouse-down events until a VNC client reconnects
and clicks anywhere.

This may inject a "mouse release" event while closing, however,
if you click on your screen and then yank the mouse cable, a mouse
release event also would not come unexpectedly, so the cure's
side effects aren't as bad as the disease.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
9 months agox0vncserver: Add support for systemd socket activation 1716/head
Mike Looijmans [Fri, 12 Jan 2024 08:24:48 +0000 (09:24 +0100)]
x0vncserver: Add support for systemd socket activation

systemd can pass in sockets as file descriptors 3 and beyond. Allows
the server to use socket activation.

When triggered by systemd, no other listening sockets (e.g. rfbport) will
be activated.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
9 months agoSet Pixmap depths after creating visuals
Pierre Ossman [Wed, 10 Jan 2024 15:47:56 +0000 (16:47 +0100)]
Set Pixmap depths after creating visuals

This affects the ordering of visuals, which breaks some buggy
applications that assume the first visual is the root window visual.

9 months agoUpdate copyright year to 2024
Samuel Mannehed [Tue, 9 Jan 2024 13:27:51 +0000 (14:27 +0100)]
Update copyright year to 2024

9 months agoXvnc: do not use dup2() to create a file descriptor for -inetd option 1714/head
Jan Grulich [Mon, 8 Jan 2024 12:19:01 +0000 (13:19 +0100)]
Xvnc: do not use dup2() to create a file descriptor for -inetd option

Use dup() instead to get an available file descriptor to avoid hijacking
already existing descriptor.

Fixes #1709

9 months agoMerge branch 'master' of https://github.com/zmudc/tigervnc
Pierre Ossman [Thu, 28 Dec 2023 16:02:07 +0000 (17:02 +0100)]
Merge branch 'master' of https://github.com/zmudc/tigervnc

9 months agoMerge branch 'master' of https://github.com/LMattsson/tigervnc
Pierre Ossman [Thu, 28 Dec 2023 15:56:04 +0000 (16:56 +0100)]
Merge branch 'master' of https://github.com/LMattsson/tigervnc

9 months agoPrevent incorrect cmake usage
Pierre Ossman [Thu, 28 Dec 2023 08:39:08 +0000 (09:39 +0100)]
Prevent incorrect cmake usage

It's a reoccurring issue that users try to build individual components
by pointing cmake at a specific subdirectory, e.g. 'cmake vncviewer'.
CMake, unfortunately, has insufficient protection against this so we'll
need to add a manual check.

This commit only adds it to the most likely places for misuse so we
don't have to pollute every CMakeLists.txt.

9 months agoUpdate server configure example to RHEL 9 1704/head
Linn Mattsson [Mon, 11 Dec 2023 13:12:18 +0000 (14:12 +0100)]
Update server configure example to RHEL 9

Some of the flags have been removed and we don't need to consider 32-bit
libraries anymore.

9 months agoRemove unnecessary step from building the server
Linn Mattsson [Mon, 11 Dec 2023 13:09:17 +0000 (14:09 +0100)]
Remove unnecessary step from building the server

It seems this folder is created when building the vncviewer, which has
to be built before the server.

9 months agoClarify details about requirements in BUILDING.txt
Linn Mattsson [Mon, 11 Dec 2023 13:07:54 +0000 (14:07 +0100)]
Clarify details about requirements in BUILDING.txt

9 months agoAdd missing requirements to BUILDING.txt
Linn Mattsson [Mon, 11 Dec 2023 13:06:49 +0000 (14:06 +0100)]
Add missing requirements to BUILDING.txt

10 months agoMerge branch 'keysym' of github.com:CendioOssman/tigervnc
Pierre Ossman [Wed, 13 Dec 2023 11:37:16 +0000 (12:37 +0100)]
Merge branch 'keysym' of github.com:CendioOssman/tigervnc