Commit Graph

23 Commits

Author SHA1 Message Date
Niko Lehto
24cf1f0f9a Make clipBoardPasteFrom() test more specific
Don't rely on clientCutText() to test clipboardPasteFrom().
2021-03-29 12:08:58 +03:00
Samuel Mannehed
c1160d1468 Fix color channels for VMware alpha cursors
The red and blue channels were incorrectly swapped.
2021-03-29 12:08:36 +03:00
Samuel Mannehed
70dd0058ac Simplify encodeUTF8/decodeUTF8 unittests 2021-03-29 12:07:57 +03:00
Samuel Mannehed
a4c5c38b53 Add unit tests for encodeUTF8 and decodeUTF8 2021-03-29 12:07:52 +03:00
Pierre Ossman
8be70e5ae0 Handle slow loading of images
Internet Explorer seems to flag images as loaded prematurely, which
can result in rendering bugs. We can detect this by looking at the
dimensions though.
2021-03-29 12:06:28 +03:00
Alex Tanskanen
15c74e7dc9 Fix missing caps lock events on iOS
Caps Lock on iOS only trigged key release or key press events.
When it's clicked it would only send keydown, and next time
it would only send keyup and so on. It should send both a key press
and a key release.

Also added the unit tests for macOS since those were missing.

Co-Authored-By: Alex Tanskanen <aleta@cendio.se>
2021-03-29 11:57:26 +03:00
Pierre Ossman
740a8217ab Handle missing Shift events on Windows
This is a bug in the OS that leaks through to the browsers. We need
to fake a Shift release here to avoid Shift getting stuck in the remote
session.
2021-03-29 11:57:00 +03:00
Pierre Ossman
796de9653f Send NumLock on macOS, even though the key is Clear
There is no obvious choice what works best here, but this is what
TigerVNC has been doing for years without complaints. Let's follow
them until we get reports that this doesn't work well.
2021-03-29 11:56:55 +03:00
Pierre Ossman
a8dc933701 Fix AltGr for a few more keys in IE and Edge
Some keys apparently send 'Unidentified' rather than an unshifted value.
Make sure those are also handled. Examples are \ and | on a Swedish
keyboard.
2021-03-29 11:56:40 +03:00
Pierre Ossman
62fca18cb9 Revert iOS keyup workaround
It seems Apple has fixed their buggy keyup events, so remove the
workaround and allow keys to be kept pressed again.

This is a revert of 9e99ce126ca8f6f350fa015c0e58d35103c62f7e.
2021-03-29 11:56:31 +03:00
Pierre Ossman
dc3ddc8efc Handle broken numpad delete key in Chrome 2021-03-29 11:56:24 +03:00
Pierre Ossman
7dc51fa7a5 Try to handle Meta key properly
The standards have unfortunatly caused some confusion between the Windows
key and the original Meta key. Try to handle the common case sanely at least.
2021-03-29 11:56:08 +03:00
Niko Lehto
766fc43855 Add support for VMware cursor encoding
Supports both classic cursor type and alpha cursor type. In classic
mode the server can send 'inverted' pixels for the cursor, our code
does not support this but handles these pixels as opaque black.

Co-authored-by: Samuel Mannehed <samuel@cendio.se>
2021-03-29 11:53:24 +03:00
Niko Lehto
3c3ac34eb8 Test unicode desktop names 2021-03-29 11:51:18 +03:00
Niko Lehto
8c43287afb Add support for DesktopName extension
This extension allows session name to be changed during runtime.
2021-03-29 11:50:44 +03:00
Pierre Ossman
c16cc6e2b9 Set viewport size for autoscale tests
We were incorrectly relying on the viewport being indirectly set
for us. Make sure we are explicit in what we want for these tests.
2021-03-29 11:49:41 +03:00
Pierre Ossman
c211f31113 Remove pointless Display.clear()
It served no meaningful purpose and it had bugs. So let's remove it
rather than try to fix it.
2021-03-29 11:49:36 +03:00
Pierre Ossman
4cc536636a Remove unused Display.logo attribute 2021-03-29 11:49:21 +03:00
Jesper Alf Dam
09de4b8349 Don't compact the receive buffer unless we've actually run out of space
Previously, we would compact the buffer (moving unread data to the
start of the buffer) as follows:

- after processing a message, if there are zero unread bytes, just reset
  the indices for first and last unread byte to zero
- else, if at least 1/8th of the buffer is used, copy remaining data to the beginning of the buffer

The second option is never actually necessary, as before inserting new data
into the array, we already check if there's enough free space, and
compact the buffer first if necessary. So we've been doing a lot of
copies that weren't actually needed. Let's not do that any more.
2021-03-29 11:45:00 +03:00
Pierre Ossman
7b02f3d8b8 Avoid deprecated called.once from sinon-chai
It's been removed in newer versions and will break eventually.
2021-03-29 11:44:04 +03:00
Pierre Ossman
46b7d1db95 Fix up errors and warnings in vnc_playback.html
Remove the styling, as it isn't really needed, and fix some minor
things that the w3c validator complains about.
2021-03-29 11:38:25 +03:00
Pierre Ossman
915901848d Send data one byte at a time in tests
This makes sure we don't have code assuming that everything is
neatly packaged in a single WebSocket message.
2021-03-29 11:34:38 +03:00
matt
408c005d3e Initial commit 2020-09-20 12:16:44 +00:00