It was moved to the common code in f8e3b34c6, but it was unreliable
because the state could sometimes get out of sync. Push it back in
to Xvnc since it isn't necessarily something all servers will have.
This adds the basic infrastructure and handshake for the QEMU
Extended Key Events extension. No viewer or server makes use of
the extra functionality yet though.
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.
One was missing a call to register the fd with the X server, and
one forgot to set it to non-blocking. One result of this was a crash
when hitting the blacklist.
xserver 1.19's OsInit will create a pollfd, followed by checking if fd 2 /
stderr is writable and if it is not, replacing fd 2 with /dev/null.
Since we close stderr in inetd mode to avoid xserver messages being send
to the client as vnc data, the pollfd becomes fd 2, only to be replaced
by /dev/null since a pollfd is not writable.
This commit fixes this by opening /dev/null directly after the close(2),
avoiding that the pollfd becomes fd 2.
Alan Coopersmith: Change to use dup2() for atomic switch of fd
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Use dixChangeWindowProperty() instead of ChangeWindowProperty()
ChangeWindowProperty() was removed upstream because it was redundant,
and dixChangeWindowProperty() has been around since 1.5 so we can
safely use that.
The client is not aware of where the screen is placed so it will give
us screen relative coordinates. Convert to and from these and absolute
coordinates before interacting with the input layer.
It is possible to set pointer coordinate using absolute numbers, but
getting them back will always give us screen relative ones. Do the
necessary calculations manually so we return sane values to the caller.
Handle the clipboard directly in the server, avoiding the
dependency on vncconfig. This commit adds support for clipboard
from the client to the server. Handling of the other direction
will follow.
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.
Fix race problem with detecting listening inetd sockets
The previous detection would fail if the socket closed before we
had time to inspect it, which got us stuck in a loop as we would
try (and fail) to do accept() on a non-listening socket.
Fix race problem with detecting listening inetd sockets
The previous detection would fail if the socket closed before we
had time to inspect it, which got us stuck in a loop as we would
try (and fail) to do accept() on a non-listening socket.