Samuel Mannehed [Tue, 12 Dec 2017 17:25:20 +0000 (18:25 +0100)]
Fix disconnect crash when screen doesn't exist
The function removeChild throws an exception when the element specified
doesn't exist. This can happen when opening the websocket throws an
exception during connect. Fixes issue #979
Samuel Mannehed [Tue, 12 Dec 2017 15:14:43 +0000 (16:14 +0100)]
Make error more specific at connection failure
The UI does after all have enough information to determine if the
disconnection event was received before or after we were connected. If
we were never connected at all, we should adapt the error message to
reflect this.
Pierre Ossman [Wed, 29 Nov 2017 15:37:35 +0000 (16:37 +0100)]
Forced cleanup of RFB objects in tests
We need to make sure RFB objects are properly disposed or they
might have event listeners and other stuff hanging around that can
influence subsequent tests.
Samuel Mannehed [Sat, 11 Nov 2017 00:59:13 +0000 (01:59 +0100)]
Dont overwrite more severe visible statuses
And only show the first error. This means that if UI.showStatus() is
called for a new error while one error is already showing, the new
error will not be shown. However, if a warning was showing and a new
error comes up, the warning will be overwritten.
Samuel Mannehed [Sat, 11 Nov 2017 00:48:47 +0000 (01:48 +0100)]
Abstract RFB errors to avoid sending strings
The API allowed strings to be passed from the RFB module to the
application using the disconnect reason. This caused problems since
the application didn't have control over translations for these
strings.
Most of the information being passed using this string was very
technical and not helpful to the end user. One exception to this was
the security result information regarding for example authentication
failures. The protocol allows the VNC server to pass a string
directly to the user in the security result.
So the disconnect reason is replaced by a boolean saying if the
disconnection was clean or not. And for the security result information
from the server, a new event has been added.
Samuel Mannehed [Fri, 10 Nov 2017 11:52:39 +0000 (12:52 +0100)]
Replace updatestate event with connect
Instead of exposing all the internal connection states, the RFB module
will now only send events on connect and on disconnect. This makes it
simpler for the application and gets rid of the double events that were
being sent on disconnect (previously updatestate and disconnect).
Pierre Ossman [Fri, 20 Oct 2017 14:46:36 +0000 (16:46 +0200)]
Integrate connect() in to constructor
An RFB object represents a single connection so it doesn't make
sense to have one without it trying to connect right away. Matches
the behaviour of other APIs, e.g. WebSocket.
Pierre Ossman [Sat, 14 Oct 2017 09:24:16 +0000 (11:24 +0200)]
Tidy up variable initialisation
Sort things by category, and organise everything in the same place.
We don't support reuse of RFB objects so we can safely init everything
in the constructor.
Pierre Ossman [Thu, 2 Nov 2017 14:30:36 +0000 (15:30 +0100)]
Improved focus handling on touch input field
The previous method of retaining focus didn't work reliably when
the RFB object tried to move the focus to the canvas. Add a setting
to control "focus on click" behaviour instead of letting them try
to fight it out.
Pierre Ossman [Wed, 18 Oct 2017 14:09:48 +0000 (16:09 +0200)]
Remove package-lock.json
We're an upstream component project so we prefer to keep ourselves
up to date with the latest version of our dependencies. Downstream
packagers will have to do the version locking if they feel it is
necessary.
Pierre Ossman [Mon, 16 Oct 2017 14:19:49 +0000 (16:19 +0200)]
Restore handling of key events for virtual keyboard
We broke handling of keydown/keyup when we moved the focus to the
canvas, as events from our input element would then no longer be
caught when they bubbled up to the document object (where we
previously caught events).
Restore the previous behaviour in a cleaner manner by creating a
second Keyboard object to handle this extra input variant.
Pierre Ossman [Mon, 16 Oct 2017 14:08:29 +0000 (16:08 +0200)]
Make sure control bar stays visible on Tab
Avoid the deprecated keypress event in favour of the keydown event.
It has the benefit of triggering for all keys, not just those that
produce symbols.
Pierre Ossman [Wed, 5 Oct 2016 08:21:47 +0000 (10:21 +0200)]
Add focus state for control bar buttons
The focus can now move to the canvas so it is no longer a source of
confusion. It is also important to indicate that they have focus now
that we actually respect it.