Add support for notifying clients about pointer movements
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
It seems like many of the X11 operations can end up with no pixels
actually changing. So instead of discovering and adding workarounds for
each individually we'll just check very region added if it's empty.
We get a whole bunch of very tiny areas, which is very inefficient to
deal with. Instead create a rectangle around every "list" of connected
glyphs (usually each line).
The functions might change so we need to also make sure we grab
the updated value after each call. Clean up the code to use the
same style as the rest of the Xorg code.
The check for visible drawables didn't account for compositing
which can place a window off-screen. Put all of these checks in
a common place and make sure it detects things properly.
Restructure Xvnc/libvnc.so code to avoid C++ header hacks
The internal Xorg headers are very incompatible with C++ and we've had
to resort to all kinds of hacks in order to include them in our C++
code. This approach isn't really viable long term so restructure things
so that we have a glue layer written in C that bridges the Xorg core
with the RFB classes.
Gets rid of a loooot of code and complexity.
Colour map clients are still supported through an
automatically generated map, but we lose the ability to
develop a client or server that uses colour maps
internally.
Implicit drawing operations (like window borders) are done by accessing
the screen pixmap directly. That means that hooking windows is insufficient.
The code now assumes that the drawable is a visible window, or the screen
pixmap (IOW, that all coordinates are screen relative). Had to restructure
some code that only worked on windows to get this working.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4941 3789f03b-4d11-0410-bbf8-ca57d06f2519
Redo the RandR code in Xvnc/libvnc to use the modern 1.2 API. The old
stuff was a bit buggy, and it didn't really allow us to move forward.
This commit temporarily removes the ability for the client to resize the
session. It will be readded for Xvnc in a later commit. libvnc will be
without that functionality for now, as it is very difficult to get right
there.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4931 3789f03b-4d11-0410-bbf8-ca57d06f2519
Fix a race condition where we might get updates thrown at us right after a
framebuffer switch, but before we've been given the pointer to the new
framebuffer.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4839 3789f03b-4d11-0410-bbf8-ca57d06f2519
We informed the RFB layer of RENDER operations before they were actually
carried out. Under some circumstances, this could result in an update going
out with the old framebuffer contents.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4753 3789f03b-4d11-0410-bbf8-ca57d06f2519
Avoid intersecting screen with empty clipList in vncHooksCopyArea. The
result would be empty, which means that we are not sending CopyRect
updates even though we can. Improves vertical scrolling with Firefox
and Adobe reader.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4324 3789f03b-4d11-0410-bbf8-ca57d06f2519
Sometimes we get copy requests that are partially or fully outside the
framebuffer. Not sure if this is a bug or not, but for now add some handling
to deal with these gracefully.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4230 3789f03b-4d11-0410-bbf8-ca57d06f2519
Based on patch by George Wright but heavily rewritten in order to
dynamically reallocate the framebuffer, allowing any resize.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3688 3789f03b-4d11-0410-bbf8-ca57d06f2519