Commit Graph

37 Commits (b837bd6f59c350abbd072f459be06ab2d0e1690d)

Author SHA1 Message Date
Samuel Mannehed b837bd6f59 Add camelCase rule to eslint 4 years ago
Samuel Mannehed a3e2b1e46e Standardize on camelCase in Logging 4 years ago
Samuel Mannehed 472ede66ea Standardize on camelCase in Websock 4 years ago
Samuel Mannehed da228af778 Standardize on camelCase in tests 4 years ago
Samuel Mannehed 59f5648592 Remove unused properties and variables
The code that used these were removed in the following commits:

* 9ff86fb718477515ede2d6457f06643935d76bcd (RFB._mouse_arr)
* bb6965f2e60c2301dd638383bdc792d1f10af942 (old_requestAnimationFrame)
* 490d471c53b1791398d6c30f0efce54925939f33 (Display._c_forceCanvas)
4 years ago
Samuel Mannehed 19c473f792 Properly limit mouse moves to once every 17 ms
Previous attempt in c958269 had a number of issues, this is a full
rewrite, complete with improved unit tests.

Fixes github issue #1402
4 years ago
Samuel Mannehed 8a8fa1d906 Stop send mouse clicks while dragging in view only 4 years ago
Samuel Mannehed 5a81223d96 Standardize on camelCase for functions in RFB 4 years ago
Samuel Mannehed eff38d47f9 Standardize on camelCase for variables in RFB 4 years ago
Samuel Mannehed 749ddce5b9 Add unit tests for mouse move limit 4 years ago
Alex Tanskanen b173c8854a Fix crash with too large clipboard data
If too much text is copied in the session, String.fromCharCode.apply()
would crash in Safari on macOS and Chrome on Linux. This commit fixes
this issue by avoiding apply() altogether. Also added test to cover this
issue.
4 years ago
Niko Lehto 8be81165bd Add extended clipboard Pseudo-Encoding
Add extended clipboard pseudo-encoding to allow the use of unicode
characters in the clipboard.
4 years ago
Niko Lehto 286694869b Add util for unsigned and signed int. conversion
Will be used in later commit in extended clipboard handling.
4 years ago
Niko Lehto fdeefcfab4 Add deflator helper class for deflating data
Wraps pako's deflate for easier usage.
4 years ago
Niko Lehto 24cf1f0f9a Make clipBoardPasteFrom() test more specific
Don't rely on clientCutText() to test clipboardPasteFrom().
4 years ago
Samuel Mannehed c1160d1468 Fix color channels for VMware alpha cursors
The red and blue channels were incorrectly swapped.
4 years ago
Samuel Mannehed 70dd0058ac Simplify encodeUTF8/decodeUTF8 unittests 4 years ago
Samuel Mannehed a4c5c38b53 Add unit tests for encodeUTF8 and decodeUTF8 4 years ago
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.
4 years ago
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>
4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
Pierre Ossman dc3ddc8efc Handle broken numpad delete key in Chrome 4 years ago
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.
4 years ago
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>
4 years ago
Niko Lehto 3c3ac34eb8 Test unicode desktop names 4 years ago
Niko Lehto 8c43287afb Add support for DesktopName extension
This extension allows session name to be changed during runtime.
4 years ago
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.
4 years ago
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.
4 years ago
Pierre Ossman 4cc536636a Remove unused Display.logo attribute 4 years ago
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.
4 years ago
Pierre Ossman 7b02f3d8b8 Avoid deprecated called.once from sinon-chai
It's been removed in newer versions and will break eventually.
4 years ago
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.
4 years ago
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.
4 years ago
matt 408c005d3e Initial commit 5 years ago