aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid redundant argumentsPierre Ossman2024-06-244-36/+34
| | | | | Remove redundant arguments where the method already has access to the relevant variable as an object attribute.
* Simplify code using range-based for loopsPierre Ossman2024-06-246-47/+35
| | | | | | | | | 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.
* Remove careful client iteratationPierre Ossman2024-06-241-42/+24
| | | | | | | 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.
* Prefer std::find() over manual searchPierre Ossman2024-06-245-47/+33
| | | | | Let's avoid reimplementing something basic that's available in the standard library. It also makes the code easier to read.
* Remove unnecessary headers from Security.cxxPierre Ossman2024-06-241-18/+1
|
* Mark overridden virtual functionsPierre Ossman2024-06-2467-319/+323
| | | | | Use the new "override" keyword to properly differentiate between new virtual methods, and existing virtual methods being overridden.
* Use nullptr in all C++ codePierre Ossman2024-06-2479-331/+353
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Merge branch 'present' of github.com:CendioOssman/tigervncPierre Ossman2024-06-1913-115/+173
|\
| * Slow down fake clock when no clientsPierre Ossman2024-06-191-11/+32
| | | | | | | | | | | | | | | | | | | | 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.
| * Keep frame clock running if waiting for frame tickPierre Ossman2024-06-193-5/+19
| | | | | | | | | | | | | | | | | | | | | | 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.
| * Restart the frame timer immediatelyPierre Ossman2024-06-191-3/+3
| | | | | | | | | | | | 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.
| * Add support for X Present extensionPierre Ossman2024-06-194-2/+18
| | | | | | | | | | | | | | 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.
| * Make SDesktop::start()/stop() optionalPierre Ossman2024-06-191-8/+2
| | | | | | | | | | Let's avoid requring these as a desktop implementation can now set up everything in the init() method.
| * Maintain a constant VNCServer/SDesktop connectionPierre Ossman2024-06-192-8/+13
| | | | | | | | | | | | | | | | | | 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.
| * Make it easier to change timer intervalPierre Ossman2024-06-193-6/+8
| |
| * Explicitly request timer repetitionPierre Ossman2024-06-1910-56/+53
| | | | | | | | | | | | 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.
| * Fix up Timer commentsPierre Ossman2024-06-191-27/+34
| | | | | | | | They were badly formatted, way longer than the normal 72 columns.
| * Add safety check to getNextTimeout()Pierre Ossman2024-06-191-0/+6
| | | | | | | | | | | | 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.
| * Stop treating "0" as "no timeouts"Pierre Ossman2024-06-192-14/+4
| | | | | | | | | | 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.
| * Detect conflicting timer reschedulingPierre Ossman2024-06-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Create common recursive mkdir()Pierre Ossman2024-05-302-0/+41
| | | | | | | | | | | | | | Avoid duplicating this complexity in too many places. At the same time make the interface more identical to regular mkdir(), for familiarity.
* | Use $XDG_STATE_HOME for known hosts storagePierre Ossman2024-05-301-2/+2
| | | | | | | | | | This is an often changed database, so it is better suited for $XDG_STATE_HOME rather than the more static $XDG_DATA_HOME.
* | Merge branch 'casantos-rhbz_2180903' of https://github.com/casantos/tigervncPierre Ossman2024-05-2020-98/+153
|\ \
| * | vncconfig: add option to force view-only remote client connectionsCarlos Santos2024-04-267-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Remove the network::SocketServer interface.Carlos Santos2024-04-264-46/+37
| | | | | | | | | | | | | | | | | | | | | 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>
| * | Move the AccessRights type and constants to the rfb namespaceCarlos Santos2024-04-2315-43/+99
| |/ | | | | | | | | | | | | | | | | 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>
* | Don't check pointers for zero length buffersPierre Ossman2024-05-202-4/+4
| | | | | | | | | | It's perfectly fine to give a NULL pointer if the length has explicitly been specified as zero.
* | Implement XDG Base Directory paths, deprecate ~/.vnc902024-04-263-44/+45
| |
* | Begin work on XDGBDS compliance and overrideable configs902024-03-153-23/+69
|/
* Clarify AcceptPointerEvents settingPierre Ossman2024-02-061-1/+1
| | | | | It doesn't just control button events, but all types of pointer events, including movement.
* Increase time required to override pointerClientSamuel Mannehed2024-01-261-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Break long lines in new pointerEvent logicSamuel Mannehed2024-01-261-3/+4
|
* Fix bad variable reference in file loggerPierre Ossman2024-01-251-1/+1
|
* VNCServerST: Add a timeout to pointer button ownershipMike Looijmans2024-01-222-2/+8
| | | | | | | | | | | | | | | | | | | 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>
* VNCSConnectionST: Release mouse button(s) on closeMike Looijmans2024-01-151-0/+3
| | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'keysym' of github.com:CendioOssman/tigervncPierre Ossman2023-12-139-1599/+6306
|\
| * Update keysym header filesPierre Ossman2023-11-162-1594/+2772
| | | | | | | | This make sure we have any new defines, in case we want to use them.
| * Add own keysym to name functionPierre Ossman2023-11-167-5/+3534
| | | | | | | | | | | | | | | | | | This is mainly a copy of XKeysymToString() from libX11. We've also added a wrapper that still gives a string, even if there is no name for the requested keysym. This grows the binaries a bit, but not with any extreme amount so is hopefully worth it to get better debug logging.
* | Fix logging when no working VeNCrypt typesPierre Ossman2023-12-121-3/+3
| | | | | | | | Otherwise it will log that we chose the (invalid) type 0.
* | Merge branch 'zrlee-compression-level' of ↵Pierre Ossman2023-11-202-2/+17
|\ \ | |/ |/| | | https://github.com/adamhalim/tigervnc-suite
| * Use compressionLevel in ZRLEEncoderAdam Halim2023-11-202-2/+17
| | | | | | | | | | | | This change makes the ZRLEEncoder respect a client's desired compressionLevel. The ZlibLevel option is marked deprecated and removed from the manpages.
* | Support the "%u" username alias in PlainUsersCarlos Santos2023-10-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | This permits to enable PAM for the effective user of the Xvnc process by adding this to ~/.vnc/config or /etc/tigervnc/vncserver-config-defaults: SecurityTypes=TLSPlain PlainUsers=%u Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2233204 Signed-off-by: Carlos Santos <casantos@redhat.com>
* | More graceful handling of disabled listenersPierre Ossman2023-09-081-4/+0
| | | | | | | | | | | | Don't assume a lack of TCP listeners means the server will be unreachable. There might be other methods of access, so let the higher levels do that sanity check instead.
* | Avoid legacy C function definitionsPierre Ossman2023-08-151-19/+11
|/ | | | These aren't supported in C2x, and clang will already now complain.
* More logging for server cert exceptionsPierre Ossman2023-07-051-6/+8
| | | | | Let's log a bit more details when we need to deal with certificate exceptions to make it easier to debug things.
* Allow exception for cert hostname mismatchPierre Ossman2023-07-051-9/+43
| | | | | The browsers let you add an exception for this case, so we should as well.
* Improve reporting of certificate errorsPierre Ossman2023-07-051-32/+44
| | | | | GnuTLS can help use translate certificate issues in to user presentable strings, so let's clean up that reporting.
* Allow exception for weak certificate algorithmsPierre Ossman2023-07-051-3/+43
| | | | | The browsers let you add an exception for this case, so we should as well.
* Remove double expired certificate promptsPierre Ossman2023-07-051-8/+0
| | | | This should have been done in 5f46d55.
* Allow exception for not yet activated certificatesPierre Ossman2023-07-051-3/+43
| | | | | The browsers let you add an exception for this case, so we should as well.