aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'errno' of github.com:CendioOssman/tigervncPierre Ossman2024-10-095-32/+32
|\
| * Split SystemException to handle WindowsPierre Ossman2024-10-094-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Windows has (at least) two error namespaces, both errno and GetLastResult(). These overlap, so it is important we keep track of which one we are dealing with. To make things extra problematic, the BSD socket API normally uses errno, but on Windows it has been mapped in to the GetLastResult() namespace. Try to keep better control of this by using separate classes for the namespaces.
| * Consistently use SocketException for socket errorsPierre Ossman2024-10-091-1/+1
| | | | | | | | | | | | The behaviour is not consistent as Windows doesn't use errno for socket errors, but Unix systems do. Always use the same exception to keep things somewhat sane.
* | Clear clipboard state when its not plain textSamuel Mannehed2024-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | Commit 8a80c906b9f7c08b1c664569a97d327d62c6d8ae added a check to prevent announcing clipboard when it's not plain text data. When this check triggers and we want to ignore the non-plain text clipboard, we should reset the state by no longer indicating pending clipboard, and by asking the server to clear its clipboard. This ensures we don't end up in a state where the server thinks the viewer has useful clipboard data, but it doesn't.
* | Only announce clipboard for plain text dataSamuel Mannehed2024-10-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | FLTK has support for both image and plain text clipboard data, we don't. This means we only send plain text clipboard from the viewer to the server. Some applications can get confused when we announce that clipboard is available and later don't send anything. An example of such an application is QGIS, in the remote session it froze when an image was copied on the client side. This fix means we only call announceClipboard() when the clipboard contains plain text. That means TigerVNC is now more robust and doesn't trigger freezes in buggy applications.
* | Explicitly clean up grabs on disconnectPierre Ossman2024-09-231-0/+5
|/ | | | | They are not automatically cleaned up with the window on Windows, and we might want to reconnect so we cannot rely on the process cleanup either.
* Filter duplicate server history entriesPierre Ossman2024-09-061-4/+42
| | | | | | | | A server can be specified in many different ways, so it is easy to get multiple entries in the history for the same thing. Get rid of these by parsing each entry and comparing with existing entries.
* Move recent server to top of historyPierre Ossman2024-09-061-6/+5
| | | | | It's easier for the user if the most recently used entries are at the top.
* Use std::list for server historyPierre Ossman2024-09-064-18/+25
| | | | | We don't need random access to the entries, so a list fits just as well. It also has better accessors we need.
* Handle server history with '/' in entriesPierre Ossman2024-09-061-1/+3
| | | | This happens if you've connected to a server using a Unix socket.
* Add more usage of SystemExceptionPierre Ossman2024-09-043-15/+22
| | | | | Prefer this exception for failures involving errno as it gives a better error description.
* Merge branch 'master' of https://github.com/0-wiz-0/tigervncPierre Ossman2024-08-301-0/+2
|\
| * vncviewer: add missing include for struct timevalThomas Klausner2024-08-301-0/+2
| |
* | Only read first password from filePierre Ossman2024-08-301-1/+1
| | | | | | | | | | | | | | | | Read just the first password and ignore anything else in the password file. This allows you to reuse a password file from the server that also includes a view-only password. This fixes a regression introduced in b99daad.
* | Move getUserPasswd()/showMsgBox() to CConnectionKang Lin2024-08-306-23/+36
| | | | | | | | | | Problems with the original code: A process can only establish one connection. After modification, multiple connections can be supported.
* | Improve error messages for base directory creationPierre Ossman2024-08-293-7/+10
| |
* | Handle failure getting VNC directoriesPierre Ossman2024-08-291-6/+25
| | | | | | | | | | Although rare, there are cases where we might fail to determine our base directories. Make sure the code can handle it.
* | Move base directory creation to helper functionPierre Ossman2024-08-291-25/+31
| | | | | | | | This is non-trivial now, so let's modularize this a bit.
* | Add FIXME comment regarding macOS minimise fixLinn Mattsson2024-08-271-0/+2
|/ | | | | | | | | An issue with minimise not working when in fullscreen on macOS was workaround in Pull Request #1813. The underlaying issue is currently unknown. macOS native fullscreen mode was looked into, but no clear answer was given. See #1813 for details.
* Apple only: exit FL_Window fullscreen if active in order to minimize.Rudimar Ronsoni Jr2024-08-191-0/+4
|
* Fix typosAndrew Kreimer2024-08-121-2/+2
|
* Don't adjust manually sized windowPierre Ossman2024-08-121-7/+0
| | | | | | | It's unclear why this code was ever added, and it can be very confusing that the window partially adjusts itself. The code is also in conflict with the earlier comment that states we'll leave the window size alone if it didn't perfectly match before the resize.
* Better type for pointer button maskPierre Ossman2024-08-124-15/+15
| | | | | This is a very limited bit field, so use an 8 bit type to clearly show how many bits are available.
* Don't ask for login data when reconnectingJohannes2024-08-075-2/+57
|
* Better error message for authentication failurePierre Ossman2024-08-071-0/+4
|
* Correctly handle cancelled authenticationPierre Ossman2024-08-072-1/+5
| | | | | We should not be throwing up error messages, or asking to reconnect, if the user has actively cancelled the authentication attempt.
* Avoid shadowing variablesPierre Ossman2024-06-2414-98/+114
| | | | | It's a source of confusion and possibly bugs to reuse the same variable name for multiple things.
* Use "static" for helper functionsPierre Ossman2024-06-242-3/+3
| | | | | 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.
* Simplify code using range-based for loopsPierre Ossman2024-06-244-42/+32
| | | | | | | | | 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.
* Mark overridden virtual functionsPierre Ossman2024-06-2413-45/+48
| | | | | Use the new "override" keyword to properly differentiate between new virtual methods, and existing virtual methods being overridden.
* Disable gcc NULL warning for context menuPierre Ossman2024-06-241-1/+4
| | | | | | 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.
* Use nullptr in all C++ codePierre Ossman2024-06-2426-198/+203
| | | | | 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-195-10/+6
|\
| * Explicitly request timer repetitionPierre Ossman2024-06-194-9/+5
| | | | | | | | | | | | 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.
| * Stop treating "0" as "no timeouts"Pierre Ossman2024-06-191-1/+1
| | | | | | | | | | 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.
* | Create common recursive mkdir()Pierre Ossman2024-05-301-34/+15
| | | | | | | | | | | | | | Avoid duplicating this complexity in too many places. At the same time make the interface more identical to regular mkdir(), for familiarity.
* | Merge pull request #1737 from 62832/fix-1195Samuel Mannehed (ThinLinc team)2024-05-075-32/+81
|\ \ | | | | | | Allow for alternative user config locations, deprecate `~/.vnc` in favour of XDG Base Directory Specification paths
| * | Implement XDG Base Directory paths, deprecate ~/.vnc902024-04-263-10/+35
| | |
| * | Begin work on XDGBDS compliance and overrideable configs902024-03-153-26/+50
| |/
* | Use XQueryPointer() instead to detect zaphodPierre Ossman2024-04-101-4/+8
| | | | | | | | | | | | 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.
* | Correctly set socket write notificationPierre Ossman2024-04-091-2/+0
|/ | | | | That extra add_fd() only set the read notification, overwriting any write notification set up in the lines just above.
* Set all HAVE_ macros on the top levelPierre Ossman2024-01-241-1/+0
| | | | This keep everything consistent.
* Update copyright year to 2024Samuel Mannehed2024-01-092-2/+2
|
* Prevent incorrect cmake usagePierre Ossman2023-12-281-0/+4
| | | | | | | | | | 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.
* Automatically generate keyucsmap.hPierre Ossman2023-12-132-54/+109
| | | | | All the information we need is now available in keysymdef.h, so let's get everything updated and in sync.
* Move Keysym/Unicode mapping table to separate filePierre Ossman2023-12-132-789/+800
| | | | Make it easier to see what's code and what's just a lot of data.
* Move dead/combining keys to separate tablePierre Ossman2023-12-131-39/+82
| | | | | This is a manually set up table specific for TigerVNC. For clarity, separate it out from the general keysym/Unicode table.
* Add own keysym to name functionPierre Ossman2023-11-161-10/+3
| | | | | | | | | 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 spelling errorut0045272023-11-061-1/+1
|
* Completely ignore server clipboard when unfocusedPierre Ossman2023-09-112-20/+4
| | | | | | | | | | | | | | | | | | We can get races with clipboard managers in the server that is very confusing to the user. When the clipboard changes locally, we tell the server to drop the old clipboard (as it is now lost). But we don't send over the new clipboard until we get focus again, in order to not leak more data than necessary. This causes some clibpoard managers to take over ownership in order to avoid an empty clipboard. And this takes precedence over the new client clipboard as it happened later. Effectively reverting the clipboard the user sees. Avoid all of this by simply ignoring the server when we don't have focus. This is likely what users expect anyway as they expect their currently focused application to control the clipboard, not vncviewer in the background.