| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
It is much more natural than custom methods for this very common
operation.
|
|
|
|
|
|
|
|
| |
These files don't use anything from this header, so remove the include.
This exposes some missing includes in other places, though. So add an
explicit include in the files that were relying on an indirect
inclusion.
|
|
|
|
|
| |
This matches the naming in STL, which is what we are mostly mimicing now
that we are using std::string for these functions.
|
|
|
|
|
| |
Let's use a more common type instead of something homegrown. Should be
more familiar to new developers.
|
|
|
|
|
|
|
|
| |
It's more standard and familiar than our custom CharArray type, and it
still gives us automatic freeing of the buffer.
We could probably have used std::unique_ptr instead, but we are
currently targeting older compilers where C++11 isn't standard yet.
|
|
|
|
|
| |
It's extreme overkill to inherit from CharArray just to get the
automatic freeing of the buffer when the object is destroyed.
|
|
|
|
|
|
|
| |
Get rid of all the magical re-allocation and shuffling and instead just
return a new set of strings that is fully splitted. Will consume a bit
more memory, but is a lot safer to use as there is less confusion about
ownership of memory.
|
|
|
|
|
|
| |
We mostly use classical C strings, but the memory management around them
can get confusing and error prone. Let's use std::string for the cases
where we need to return a newly allocated string.
|
|
|
|
|
| |
We know the needed space here, so let's keep it simple with a constant
size string buffer.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Avoid complicating things by moving things in to a second buffer here as
there is no need for it.
|
|
|
|
|
| |
We don't need to make extra copies of the string in most cases, so let's
simplify the code and access the string directly when we can.
|
|
|
|
|
| |
We never use Windows' "UNICODE" mode anyway, so let's get rid of this
complexity.
|
|
|
|
|
| |
This makes memory management more clear and robust when using these
helper functions.
|
|
|
|
|
| |
These are used here and there so let's make them more general rather
than hiding them in the stream classes.
|
|
|
|
|
| |
Avoid our own custom types in favour of what's already included with
C++.
|
|
|
|
|
| |
Avoid having our own custom stuff and instead use the modern, standard
types, for familiarity.
|
|
|
|
|
| |
That warning doesn't play well with Windows' GetProcAddress(), so add
some extra casting to work around it.
|
|
|
|
|
| |
These types caused an incorrect signed/unsigned behaviour, so let's make
sure we use the appropriate type.
|
|
|
|
| |
These are all truisms because of the valid range of the types.
|
|
|
|
|
| |
This allows us to separate accidentally unused, from explicitly unused
parameters, which allows us to turn on such checks in the compiler.
|
|
|
|
|
| |
Modern cmake has better support for adding source files and libraries
incrementally, so let's use that to clean things up.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Major restructuring of how streams work. Neither input nor output
streams are now blocking. This avoids stalling the rest of the client or
server when a peer is slow or unresponsive.
Note that this puts an extra burden on users of streams to make sure
they are allowed to do their work once the underlying transports are
ready (e.g. monitoring fds).
|
|/
|
|
| |
This is fine for simple structs but not class based objects.
|
|
|
|
|
|
| |
We had an unintentional conflict with PixelBuffer::setSize() here.
But we can simplify this further as this initialization is only used
by the subclass DeviceFrameBuffer, and only once.
|
|
|
|
|
|
|
|
| |
Provides safety against them accidentally becoming negative because
of bugs in the calculations.
Also does the same to CharArray and friends as they were strongly
connection to the stream objects.
|
|
|
|
|
|
| |
Don't allow subclasses to just override dimensions or buffer details
directly and instead force them to go via methods. This allows us
to do sanity checks on the new values and catch bugs and attacks.
|
|
|
|
|
| |
Window hooks aren't working well on modern systems so switch the
default to polling until we can fix things.
|
|
|
|
|
| |
In prepartion for better clipboard extensions that can send Unicode
data between the client and server.
|
|
|
|
|
| |
Change the internal clipboard API to use a request based model in
order to be prepared for more advanced clipboard transfers.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This is required by the protocol so we should make sure it is
enforced. We are tolerant of clients that violate this though and
convert incoming clipboard data.
|
|
|
|
|
| |
It is not enough to create an exception object, you need to throw
it as well.
|
|
|
|
|
|
| |
It doesn't belong on each socket server object as timers are global.
Force implementations to call the Timer system directly instead,
avoiding any middle men.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
It is functionality specific to WinVNC, so move the code there
to make things more clear.
|
|
|
|
|
| |
Make things simpler by making this a part of the SDesktop interface
that always needs to be implemented.
|
|
|
|
|
| |
Applets don't work anymore so remove everything that has to do
with serving them.
|
|
|
|
|
| |
Shift+Alt often generates Meta on Unix systems. Assume this is the
same thing as Alt on Windows.
|
|
|
|
|
| |
We use polymorphic exception objects, so catching by value invokes
the copy constructor and stuff that we don't really want.
|
|
|
|
|
|
| |
It cannot keep itself in sync with the actual screen contents well
enough for CopyRect to work accurately. Graphical glitches could
be seen in some cases.
|
|\ |
|
| |
| |
| |
| |
| | |
Ctrl+Alt+Delete requires special handling to trigger on Windows.
Make sure this works in raw keyboard mode as well.
|
| |
| |
| |
| |
| | |
Windows mostly follows the AT set 1 scan codes that we want, but
there are a few exceptions.
|
|/ |
|
|
|
|
| |
It was only used by WinVNC, so push it there instead.
|
|
|
|
|
|
|
|
|
|
|
| |
If scan codes are available using QEMU Extended Keyboard Messages
from clients, use that to inject scancodes directly into the
system using the SendInput API.
No conversion is needed as Windows uses the same scancode encoding.
Signed-off-by: Rahul Kale <Rahul.Kale@barco.com>
Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
|