aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/XDesktop.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Better type for pointer button maskPierre Ossman2024-08-121-1/+1
| | | | | This is a very limited bit field, so use an 8 bit type to clearly show how many bits are available.
* Remove InputHandler interfacePierre Ossman2024-08-121-3/+0
| | | | | The different uses of this interface are not that closely related and there is no need for them to have a common interface class.
* Improve x0vncserver key allocation log linePierre Ossman2024-08-061-1/+2
| | | | | Follow the standard XK_ prefix, and also include the hex value for easier debugging.
* Improve unknown keysym handlingGaurav Ujjwal2024-06-301-15/+52
| | | | | | Instead of giving up after all free keycodes have been used, Keycodes from previously added keysyms will be reused. Re: #93
* Avoid redundant argumentsPierre Ossman2024-06-241-10/+10
| | | | | Remove redundant arguments where the method already has access to the relevant variable as an object attribute.
* Prefer std::find() over manual searchPierre Ossman2024-06-241-6/+6
| | | | | Let's avoid reimplementing something basic that's available in the standard library. It also makes the code easier to read.
* Use nullptr in all C++ codePierre Ossman2024-06-241-13/+13
| | | | | 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-191-4/+6
|\
| * Maintain a constant VNCServer/SDesktop connectionPierre Ossman2024-06-191-4/+6
| | | | | | | | | | | | | | | | | | 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.
* | Remove the network::SocketServer interface.Carlos Santos2024-04-261-0/+2
|/ | | | | | | 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>
* Fix missing XRandR buildPierre Ossman2023-06-141-1/+4
| | | | Make sure we can actually build without XRandR libraries.
* Fix missing XFixes buildPierre Ossman2023-06-141-0/+2
| | | | Make sure we can actually build without XFixes libraries.
* Fix missing XTest buildPierre Ossman2023-06-141-1/+10
| | | | Make sure we can actually build without XTest libraries.
* Remove unneeded "using namespace"Pierre Ossman2023-06-141-1/+0
| | | | The need for these must have got lost somewhere in the type cleanup.
* Merge branch 'types' of https://github.com/CendioOssman/tigervncPierre Ossman2023-03-021-9/+10
|\
| * Remove unneeded header from SDesktop.hPierre Ossman2023-02-041-0/+1
| | | | | | | | It doesn't use any exceptions, so stop including the header for it.
| * Return static char buffer from some methodsPierre Ossman2023-02-041-2/+2
| | | | | | | | | | | | | | | | | | This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage.
| * Use stdint typesPierre Ossman2023-02-011-7/+7
| | | | | | | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* | Sanity check when cleaning up keymap changesPierre Ossman2023-02-091-0/+4
|/ | | | | Make sure we don't send a bogus request to the X server in the (common) case that we don't actually have anything to restore.
* Explicitly mark unused parametersPierre Ossman2023-01-041-1/+1
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
*-. Merge branches 'x0vncserver-keyboard' and 'zaphod-fixes' of ↵Pierre Ossman2022-12-011-10/+171
|\ \ | | | | | | | | | https://github.com/grulja/tigervnc
| | * x0vncserver: update/display cursor only on correct screen in zaphod modeJan Grulich2022-08-241-7/+53
| |/ |/| | | | | | | | | | | | | | | | | | | 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>
| * x0vncserver: add new keysym in case we don't find a matching keycodeJan Grulich2022-12-011-3/+118
|/ | | | | | | | | 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.
* Improve logging around screen resizingPierre Ossman2022-01-251-6/+0
| | | | | | Avoid duplication, and add logging for some more error conditions so it's possible to see in the logs why a resize has failed or produced unexpected results.
* Be consistent in including config.hPierre Ossman2021-12-301-0/+4
| | | | | | The generally recommended way is to include it from source files, not headers. We had a mix of both. Let's try to be consistent and follow the recommended way.
* Correctly handle screen layout with offsetPierre Ossman2021-06-171-5/+8
| | | | | | 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.
* Add support for notifying clients about pointer movementslhchavez2021-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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). Part of: #619 1: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#vmware-cursor-position-pseudo-encoding 2: https://tronche.com/gui/x/xlib/input/XWarpPointer.html 3: https://hg.libsdl.org/SDL/file/28e3b60e2131/src/events/SDL_mouse.c#l804
* Handle clients lost during queryingPierre Ossman2020-05-211-2/+12
|
* Clean up internal clipboard handlingPierre Ossman2019-07-011-1/+1
| | | | | | We now filter incoming data, which means we can start assuming the clipboard data is always null terminated. This allows us to clean up a lot of the internal handling.
* Merge branch 'connparams' of https://github.com/CendioOssman/tigervncPierre Ossman2018-12-101-0/+19
|\
| * Make sure we always have a valid screen layoutPierre Ossman2018-12-101-0/+5
| | | | | | | | | | Add more checks and fix some callers to make sure that the server core always has a valid screen layout configured.
| * Respect geometry setting in screen layoutPierre Ossman2018-11-011-0/+14
| | | | | | | | | | We might only be using part of the X server's screen, so make sure the layout we calculate is contained within this part.
* | Merge branch 'exittimer' of https://github.com/CendioOssman/tigervncPierre Ossman2018-11-091-0/+6
|\ \
| * | Properly terminate server on timeoutsPierre Ossman2018-11-091-0/+6
| | | | | | | | | | | | | | | | | | Do a proper cleanup when one of the termination timeouts trigger rather than just exiting on the spot. This makes sure we don't leave stray stuff around, e.g. unix socket files.
* | | Merge branch 'vncserver' of https://github.com/CendioOssman/tigervncPierre Ossman2018-11-091-1/+52
|\| |
| * | Inherit SocketServer directly from VNCServerPierre Ossman2018-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | This makes VNCServer a sufficiently complete interface that callers don't need to know about the specific implementation (VNCServerST currently). And assuming that all servers will use sockets is not that outrageous.
| * | Encapsulate client handling in VNCServerSTPierre Ossman2018-10-261-0/+2
| | | | | | | | | | | | | | | | | | Removed the last parts of VNCSConnectionST's back door in to VNCServerST and let the parent class fully handle coordination of clients, and access to the desktop.
| * | Remove QueryConnectionHandlerPierre Ossman2018-10-101-0/+49
| |/ | | | | | | | | Make things simpler by making this a part of the SDesktop interface that always needs to be implemented.
* / Adjust XDamage tracking to geometryPierre Ossman2018-11-051-0/+2
|/ | | | | We might have an offset in the area of the screen we're tracking, so make sure that offset is included in the changes we report.
* Fix bad color of cursor with x0vncserverPierre Ossman2018-09-181-6/+5
| | | | | We cannot assume endian-ness for the cursor we get from XFixes. Adjust the algorithm to properly follow the specification.
* Explicitly check screen layout after changePierre Ossman2018-09-111-4/+7
| | | | | | | | There are some cases where the server state will not automatically be updated on a change. A prominent one is when only RFB attributes were changes (e.g. the screen ID) but nothing else. In that case there is no actual change in the X server, so it never sends any notification about change back to us.
* Adjust cursor position according to geometryPierre Ossman2018-09-101-0/+2
| | | | | x0vncserver might only be observing part of the display, so we need to adjust any coordinates before we give them to the RFB core.
* Add debug output for x0vncserver key eventsPierre Ossman2018-07-251-1/+5
|
* Handle Shift+Tab (ISO_Left_Tab) in x0vncserverPierre Ossman2018-07-251-4/+10
|
* Add RandR support for x0vncserverPeter Åstrand (astrand)2018-04-091-2/+287
| | | | | | | | Change Xserver screen through libXrandr. For complex configurations, all outputs must have corresponding size modes. As a special case, if the client requests a single screen with an odd size (for example when adjusting the size of a non-fullscreen vncviewer), find a smaller suitable mode, and reduce the framebuffer size as well.
* Fix indentation in XDesktop.cxxPierre Ossman2018-03-071-257/+257
| | | | | It wasn't properly updated in 3112f50 when it was split off from x0vncserver.cxx.
* Unset pixel buffer when x0vncserver client disconnects.Michal Srb2018-03-071-1/+5
| | | | | | In XDesktop::start() we allocate pixel buffer and set it as the backend to the given VNCServer. In XDesktop::stop() we deallocate the buffer, so we must unset it from the VNCServer as well. Otherwise the VNCServer could try to access it and crash, for example in deferred update.
* Move XDesktop specific parameters in to same filePierre Ossman2017-11-081-2/+5
|
* Removed IRIX/Solaris overlay supportPeter Åstrand (astrand)2017-11-081-2/+1
| | | | Legacy systems.
* Added my/Cendio copyright where relevantPeter Åstrand (astrand)2017-11-081-0/+1
|