Samuel Mannehed [Sat, 17 Sep 2016 22:52:25 +0000 (00:52 +0200)]
Remove unnecessary substates of disconnected
The states 'loaded', 'failed' and 'fatal' were all variations of the
'disconnected' state. Removing these states allows us to get rid of
many ugly workarounds and special cases. Error messages to the UI can
now instead be delivered via a new onDisconnected callback.
Samuel Mannehed [Fri, 16 Sep 2016 10:12:10 +0000 (12:12 +0200)]
Improve the connection state names
Names such as 'disconnect' and 'disconnected' are inconsistent in the
way that one describes an action and the other a state. The state that
was called 'normal' didn't fit in with the others because the other
names describe a connection state. The new names are: 'disconnecting',
'connecting' and 'connected'
Samuel Mannehed [Mon, 29 Aug 2016 12:56:57 +0000 (14:56 +0200)]
Remove special password state
We already have a callback mechanism for this, so let's use that.
Adds an optional parameter 'msg' to the callback.
Fixes vnc_auto.html (#646) which was broken after 4e0c36dda708628836dc6f5d68fc40d05c7716d9
Pierre Ossman [Wed, 14 Sep 2016 14:10:24 +0000 (16:10 +0200)]
Let CSS update UI for touch and connected state
Avoid a lot of JavaScript code that can easily be handed using
style sheets instead, specifically items that should only be shown
when on a touch device, or items that depend on the connected state.
Samuel Mannehed [Mon, 29 Aug 2016 12:46:58 +0000 (14:46 +0200)]
Add a separate dialog for the password prompt
The user might be queried for the password during the connect stage
if no password was previously provided. Add a separate dialog for
this rather than abusing the connect dialog.
samhed [Wed, 24 Aug 2016 16:03:32 +0000 (18:03 +0200)]
Avoid ambigious optional arguments
Some functions weren't obvious what they would do if an argument was
omitted. Split them up in to separate functions in those cases to
make the API clearer.
samhed [Wed, 24 Aug 2016 09:06:23 +0000 (11:06 +0200)]
Strict positioning of panels
The panels were never meant to be positioned relative their container,
so make sure they pop up exactly where we want in the viewport, no
matter where they are in the structure.
Dmitry Sankevich [Wed, 16 Dec 2015 09:35:23 +0000 (15:35 +0600)]
Fix TIGHT negotiation with zero sub-auth types
According to the RFB protocol, when in TIGHT auth negotation,
if the client receives a sub-auth count of zero, it should proceed
as if the `None` sub-auth type had already been selected (and not
send a message selecting that type).
Lars Ole Hurlen [Fri, 11 Mar 2016 07:32:50 +0000 (08:32 +0100)]
Detect RealVNC's RFB 5.0 Protocol Version
The RFB protocol specifies a max version of 3.8, but RealVNC likes to
increment their version when they add new features. RealVNC 5.3 sends
"005.000" as the version string, since they've extended their
implementation upon RFB v3.8. We can detect that, and just tell them we
only speak 3.8, instead of barfing on "005.000" as an invalid version.
Solly Ross [Wed, 14 Sep 2016 17:45:08 +0000 (13:45 -0400)]
Move input-related files into core/input
This commit moves all the input-related files from `core/`
to `core/input/`, and renames a couple as relevant
(input.js --> input/devices.js, keyboard.js --> input/util.js).
Solly Ross [Sat, 3 Sep 2016 18:06:42 +0000 (14:06 -0400)]
Remove unecessary event-related code from Util
The event-related wrapper functions in Util existed mainly for
backwards-compat. However, all currently supported browsers
support the standard functions, so these wrappers are no longer needed.
Solly Ross [Sat, 3 Sep 2016 17:58:32 +0000 (13:58 -0400)]
Util shouldn't modify window object
This commits prevents Util from modifying the window object.
- `window.requestAnimFrame` was removed (no polyfill is needed anymore)
- the potential redefinition of `console.log` and friends was removed
(all supported browsers have `console.xyz` defined anyway)
Solly Ross [Sat, 3 Sep 2016 17:53:47 +0000 (13:53 -0400)]
Switch to PhantomJS 2.x for testing
This commit switches over to use PhantomJS 2.x, bringing in a whole host
of improvements (including `Function#bind`, so we can remove the
`Function#bind` shim in core/util.js).
Solly Ross [Sat, 3 Sep 2016 17:49:55 +0000 (13:49 -0400)]
Don't modify Array prototype
This commit removes our modification of the Array prototype.
It wasn't actually used much in the main code, anyway, and it's a
bad practice to modify built-in prototypes.
Solly Ross [Wed, 14 Sep 2016 17:52:53 +0000 (13:52 -0400)]
Enable noVNC to become Browserifiable
This commit restructures noVNC, splitting it into the core directory
and the app directory, with the former containing core noVNC parts,
and the latter containing parts specific to the application.
Added a 'QEMUKeyEventDecoder' method to deal with the
key events generated when the QEMU extension is active. Another
method, 'TrackQEMUKeyState', was also created with this same
goal.
Although both methods have similaries with the existing methods
'KeyEventDecoder' and 'TrackKeyState', specially when dealing
with 'supress' and 'releaseall', the logic behind the QEMU extension
does not required keysym generation for most cases (some NumPad keys
are an exception) and, as such, there is no need to treat 'keyPressed'
events and to handle char modifiers.
'TrackQEMUKeyState' also handles a Windows scenario where the
'AltGR' key generates CtrlLeft and AltRight keystrokes. The solution
was to avoid this specific combination to be sent to the VNC server,
discarding the extra 'CtrlLeft' key. Considering that the user can
send CtrlLeft+AltLeft, CtrlRight+AltRight and even CtrlRight+AltLeft,
this workaround to allow Windows users to use AltGR in their noVNC
sessions is worthwhile.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
In input.js, a new keyboard handler was added to deal exclusively
with the QEMU key event extension. '_onKeyPress()' signature
was changed to allow the same method to treat both cases.
The extension will only be enabled if the browser has support
for the KeyboardEvent.code property.
Changes in rfb.js:
- added a new extension code, QEMUExtendedKeyEvent, value -258.
- handleKeyPress now receives 'keyevent' instead of 'keysym' and
'down'. Both values are retrieved from keyevent as they were
in the previous signature. This method now can send QEMU RFB
extended key messages if the flag was set to 'true'.
- tests/test.rfb.js were changed folowing the onKeyPress() signature
change.
- added a new function to send the QEMU extended key message.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
samhed [Thu, 2 Jun 2016 14:41:38 +0000 (16:41 +0200)]
Add support for ContinuousUpdates
Instead of requesting frame buffer updates we can, if the server
supports it, continuously recieve frame buffer updates at a rate
determined by the server.
The server can use fencing messages and measure response times to
determine how often it will continue to send updates.
Solly Ross [Wed, 24 Feb 2016 21:13:06 +0000 (16:13 -0500)]
Revert poor workaround for brief Firefox bug
This commit reverts a fix for a bug which briefly occured on certain
nightlies of Firefox. It was never intended to persist in the code
base, and is causing other actual errors to be swallowed.
Solly Ross [Tue, 22 Dec 2015 20:16:52 +0000 (15:16 -0500)]
Fix ImageData Constructor Support Detection
Our support detection for the `ImageData(data, width, height)` constructor
would fail in certain browsers because the size of a 1x1 ImageData's
Uint8ClampedArray is 4, not 1.
nunojusto [Tue, 16 Aug 2016 21:10:14 +0000 (22:10 +0100)]
Update launch.sh
Just a correction of port in use test algoritm.
This way we will not have problems when using port X and having some other service using zyX or any *X port