Commit Graph

570 Commits (7078884c129705aeec968b74e984f7393bb1066f)
 

Author SHA1 Message Date
Samuel Mannehed c1160d1468 Fix color channels for VMware alpha cursors
The red and blue channels were incorrectly swapped.
4 years ago
Juanjo Diaz 1c38b6f120 Remove generated HTML by Cursor when it detaches 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
Samuel Mannehed 789308212b Remove unused python scripts 4 years ago
Samuel Mannehed ce5fe304cb Fix chinese translation for "Disconnect"
Thanks for @wavezhang, @litongjava, and @bhzhu203 for helping out.
4 years ago
Samuel Mannehed 781075c841 Update chinese translation strings
Thanks to @QQ2017 and @wavezhang for helping out with correcting these.
4 years ago
Samuel Mannehed 2f43cead79 Add comment for browser and platform detection 4 years ago
Samuel Mannehed e7a5aa271e Add short description at the top of browser.js 4 years ago
Samuel Mannehed ad206180d2 Properly detect scrollbar gutter
As a rule, instead of hard-coding a behavior on specific platforms we
should do dynamic detection.

This commit moves away from always hiding scrollbars on Android and iOS
and instead detects the rendered width of scrollbars in the browser.
4 years ago
Pierre Ossman 89dd199317 Allow cursor to be updated while connecting
We haven't got a server provided cursor at this point, but we might
have done something local, e.g. enabled the dot cursor.
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
Samuel Mannehed ce94d92e18 Build in the behavior to ignore decodeUTF8 errors
Makes the code clearer and more explicit in intent.
4 years ago
Samuel Mannehed c3ef9ff557 Peter is no longer part of the noVNC team 4 years ago
Chris \"Koying\" Browet c0276776e9 Add support for Unix Tight auth 4 years ago
VanyM 10f4aa9e7b Add try catch in every place that uses decodeUTF8 4 years ago
Samuel Mannehed b2dc76ee18 Add encodeUTF8 function to core/util/strings.js 4 years ago
Pierre Ossman 12cdad066e Make Cursor.detach() safe to call when not attached
Avoids having checks in higher layers.
4 years ago
Samuel Mannehed a850be4afa Fix chinese translation errors
Thanks to @QQ2017 for providing the translation strings
4 years ago
Samuel Mannehed 354d544843 Simplify logic for status hierarchy
Removes unnecessary variable
4 years ago
Samuel Mannehed 0bf9403a36 Ensure warning status timeouts are honored
When showing a new status popup we want to set a timer for how long to
show it. In cases where we show many statuses in a fast succession we
need to remove any running timeouts when showing a new one.

There are exceptions when new statuses won't be shown, and thats if a
more severe status is already showing, i.e and error or a warning.

Warnings can still have timeouts. There was a bug that occured when we
tried to show a normal status while a warning was showing. The bug
caused the warning status timeout to be removed even if the normal
status was never shown. We should only remove running timeouts if we're
actually going to show a new status.
4 years ago
Pierre Ossman 29db8997ec Don't use arrow functions in legacy loader
The browsers that need the legacy code do not support such fancy
modern things.
4 years ago
Pierre Ossman 46f15667f7 Load support scripts first
E.g. SystemJS requires the Promise polyfill, so make sure all our
support files are loaded first.
4 years ago
Pierre Ossman edb5fee88b Upgrade to latest babel
There has been a lot of renaming and restructuring in babel, so we need
to modify our code to handle the latest version. We also need to adjust
the way we build our babel worker as babel itself no longer runs in older
browsers such as Internet Explorer.
4 years ago
Pierre Ossman 23871b42d1 Always include Promise polyfill for legacy browsers
It is now used by our general code and not just by the conversion
routines, so we need to make sure it is always included for the
old browsers.
4 years ago
Pierre Ossman d6d875ef3b Clean up handling of untransformed files
This control flow is difficult enough as it is to follow. Move the
handling of the untransformed files to a separate block to make it
slightly easier to understand.
4 years ago
Pierre Ossman 6c84631bbc Remove redundant "no copy" check
We also check this list as a filter to walkDir(), so no need for the
extra check here.
4 years ago
wavezhang 6bb87ee2b2 Update zh_CN.po
fix spell errors, improve translations
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
Samuel Mannehed f1be4be653 Add README to app/locale warning not to modify 4 years ago
Alex Tanskanen b5f1a00282 Add "macOS shuffle" to iOS as well
Since iOS functions like macOS with regards to Alt behaving like AltGr,
we need the same workaround on iOS as well.
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 6916c83b48 Fix typo for MailSend key 4 years ago
Pierre Ossman d10d7167f6 Update to latest UI Events key specification 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
Samuel Mannehed d61bf69c33 Keep the virtual keyboard after using extra keys
If using the extra keys always gives focus to the screen then an
on-screen keyboard would be closed. When using on-screen keyboards we
instead want to give focus to our virtual keyboard input element.
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 e497b53d09 Explain why Clear maps to KP_Begin 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
Samuel Mannehed 443858cf83 Move focus to the screen when using extra keys
A regression from 2afda54 and friends was that you couldn't use the
extra keys and then directly use the keyboard, you would have to click
in the session first.

This commit restores the correct behavior and also adds a visual queue
to the fact that the screen got the focus by fading the controlbar.
4 years ago
Samuel Mannehed 6b39933658 Add missing scancode for sendTab 4 years ago
Samuel Mannehed 6067290169 Rename document.capturedElem to captureElement
To better fit most naming.
4 years ago
Pierre Ossman a8699ab8cb Improve Windows key image
The previous one didn't have sharp lines, or follow pixel boundaries
properly.
4 years ago
Samuel Mannehed 996895268e Hide the emulated cursor when target is null
Makes it easier to understand what happens when a real element isn't
passed as a target to updateVisibility(). Also makes the code more
robust to future changes.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Samuel Mannehed fb14c2dec9 Fix disappearing cursor after click
In the cursor emulation when deciding if the cursor should be hidden -
Instead of checking what's under the cursor, we check the element that
has capture.

This introduced another bug in the cursor emulation. The cursor did not
always disappear properly when using our cursor emulation together with
our setCapture polyfill. More specifically, we saw a problem when a
capture ended on an element without cursor emulation.

We solved this by introducing another visibility check on a timer in
the cursor emulation. However this led to yet another problem where
this timer conflicted with the timer in the setCapture polyfill.

We removed the timeout in the setCapture polyfill and created a
variable to make sure that all the events remaining in the queue can be
completed.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Samuel Mannehed 83d5e5bffd Check next elem at mouseleave in cursor emulation
It's not obvious that we want to hide the cursor when we get a leave,
it depends on the element that we're leaving to. This makes the code
more robust.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Samuel Mannehed 19dfb7901c Rename variables in setCapture proxy
The names of many variables were too similar. To make the code easier
to follow we renamed:

* _captureElem to _capturedElem
* _captureElemChanged() to _capturedElemChanged()
* captureElem to proxyElem
* elem to target

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
4 years ago
Pierre Ossman 6acf3c9e62 Never show drag icon if clipping is disabled
Toggling the enabled state is a remnant from an earlier version
of the code where we could determine if the the session is actually
clipped, and not just that the setting is enabled.

Right now we only change things based on the setting, so let's
completely hide the button when clipping is disabled.
4 years ago