Commit Graph

1399 Commits

Author SHA1 Message Date
Solly 40b35fa20d Merge pull request #524 from kanaka/bug/tight-buffer-overread
Fix buffer over-reads in handle_tight
2015-08-27 18:46:26 -04:00
Solly Ross 89bdc8ce48 Fix buffer over-reads in handle_tight
For performance reasons, the `handle_tight` function skips the
use of the receive queue API and uses the raw receive queue directly.
Because of the way that typed array receive queue gets reused, this
introduced the potential for buffer over-reads.

To address this, a new function, `rQwhole`, was introduced.
`rQwhole` simply returns a new view into the receive queue that
starts at 0 and ends at the current recorded end of the queue.

`handle_tight` now makes use of this function.

Fixes #522
2015-08-26 14:31:23 -04:00
Solly Ross a369a80c24 Fix bug in non-true-color code
There was a bug caused by 38781d931e
which prevented color map look-ups sent by rfb.js from working properly,
since display.js expected a single-item array, and rfb.js sent just them
item value itself (a number) instead.  This fixes that, and tweaks the
corresponding test to match that behavior.
2015-08-24 19:34:30 -04:00
Solly Ross bb180145c6 Tests: Fixed bug in displayed assertion
This `displayed` assertion had a bug that was causing it to not
actually check anything (it was using obj.length instead of
data_cl.length).  This fixes that.
2015-08-24 19:30:44 -04:00
Solly Ross 340290fa1d UI: Fix typo preventing reconnect after password
There was a typo in ui.js preventing the use of the connect button
after a password was entered.
2015-08-24 16:41:00 -04:00
Solly abf2b09ea7 Merge pull request #488 from kanaka/feature/more-perf-improvements
Performance Improvements
2015-08-14 11:56:57 -04:00
samhed a825582196 Only work with integers when panning to avoid getting a blurry image.
Also disable image-smoothing to avoid bugs seen on Android which were
also causing a blurry image while panning.
2015-08-14 17:02:00 +02:00
Solly Ross f00193e08f Skip unnecessary render queue object creation
This commit skips object creation for the render queue when not
needed.  Instead of pushing an object onto the queue, and then
immediately running the result, you call the function directly.
Then, if the render queue is not empty, an object is created and
pushed onto the queue.  Otherwise, the functionality is just run
directly.
2015-08-06 14:47:03 -04:00
Solly Ross b0b5fc55e1 Fix multi-line assertion messages in test runner
This commit prevents multi-line error messages from being
truncated in the local test runner ('tests/run_from_console.js').
2015-08-06 14:47:03 -04:00
Solly Ross 07f514d887 Allow the use of the PhantomJS remote debugger
This commit adds the '--debugger <port>' option, which triggers
the PhantomJS remote debugger.  The initial output of the terminal
when running the debugger gives more information on how to use
it.
2015-08-06 14:47:03 -04:00
Solly Ross 9ff86fb718 Use Typed Arrays for the send queue
This commit converts the send queue to use typed arrays, and converts
message creation functions in 'rfb.js' to create messages directly into
the socket's send queue.  This commit also removes the separate mouse array,
which is no longer needed.
2015-08-06 14:47:03 -04:00
Solly Ross d1800d0960 Avoid Creating Small Objects Frequently
Creating lots of small objects frequently can drastically decrease
performance.  This commit introduces three fixes which avoid this:

- Use a preallocated palette and indexed-to-rgb destination Typed Array
  (the destination typed array is currently allocated at `4 * width *
  height`).

- Inline `getTightCLength`, which returned a two-item array.

- Pass RGBX data directly in a Typed Array to the Display, which
  avoids an extra loop, and only creates a new Typed Array View,
  instead of a whole new ArrayBuffer.
2015-08-06 14:47:03 -04:00
Solly Ross 38781d931e Use Typed Arrays for the Websock receive queue
**This commit removes Base64 (and Flash) support**

This commit converts websock.js to used Typed Arrays for the
receive queue (and tweaks rfb.js to ensure that it continues
to function, since only Firefox implements
`%TypedArray%.prototype.slice`).  Base64 support was removed
to simplify code paths, and pave the way for using Typed Arrays
for the send queue as well.

This provides two advantages: first, we allocate a buffer ahead
of time, meaning the browser doesn't have to do any work dynamically
increasing the receive queue size.  Secondly, we are now able to pass
around Typed Array Views (e.g. `Uint8Array`), which are lightweight, and
don't involve copying.

The downside is that we initially allocate more memory -- we currently
start out with 4 MiB, and then automatically double when it looks like
the amount unused is getting to small.

The commit also explicitly adds a check to the compacting logic that
avoids calling the copy functions if `_rQlen === _rQi`.
2015-08-06 14:47:03 -04:00
Solly Ross 6c883653a2 Remove unecessarily nested loop
This commit removes a nested loop in indexedToRGB, converting it into a
plain loop without multiplication.
2015-08-06 14:47:03 -04:00
Solly Ross 6940936ffc WIP: Switch to Pako for zlib
This commit introduces an alternate implementation of the zlib
decompressor based on Pako (https://github.com/nodeca/pako).
2015-08-06 14:47:03 -04:00
Solly Ross 0442e153a1 Fix RFB.js JSHint Errors
This fixes a couple of JSHint errors in RFB.js caused
by using `==` instead of `===`.
2015-08-06 14:47:03 -04:00
Solly Ross efed2eeafd Fix up vnc_playback.html and playback.js
This commit fixes vnc_playback.html and playback.js
so that they work with the current version of noVNC.
2015-08-06 14:47:03 -04:00
Solly Ross bc4414f5b1 CI: Switch to Container-Based Travis
This commit switches the Travis tests over to Travis's new
container-based infrastructure.  It also tells Travis to
cache the node_modules directory for faster setup.
2015-08-06 14:43:02 -04:00
Samuel 8f3c0f6b9b Merge pull request #499 from samhed/fullscreen
Add option to toggle fullscreen mode
2015-07-01 13:16:53 +02:00
samhed a6357e8276 * Hide the fullscreen toggle button on Safari since alphanumerical
keyboard input doesn't work in fullscreen.
* Force clipping mode in Internet Explorer while in fullscreen since
  scrollbars doesn't work in fullscreen.
2015-06-25 22:37:05 +02:00
samhed 6e296bfa8a Adapt display to be able to handle a changing clipping-setting while connected 2015-06-25 22:37:05 +02:00
samhed 7d1dc09ad0 Fixes #498 - Add the ability to toggle fullscreen mode 2015-06-25 22:37:05 +02:00
samhed b098afc234 Fix error from a previous commit, there is no data type called 'text'.. 2015-06-25 22:34:44 +02:00
samhed 74f2ac968d Renamed popupStatusPanel to popupStatus and removed the global variable
which kept track on if it was open or not (it automatically closes after
1.5 seconds anyway).
2015-06-25 17:04:55 +02:00
samhed 30bfff81d9 Clarified enableDisableClip (now called enableDisableViewClip) and
moved it to where the other clipping functions are.
2015-06-25 15:29:23 +02:00
samhed 4f19e5c697 Allow the popupStatusPanel to show any text but close it on a 1.5 second timer. 2015-06-25 15:22:53 +02:00
samhed 31ddaa1c7a Clarify code with regards to the viewport drag functionality
* Fixes #502 so that the viewport drag functionality can't get stuck
2015-06-24 16:20:03 +02:00
samhed 29a0e6a8a3 Always show the viewport drag button on touch devices to keep the GUI from
"jumping around". Enable/disable the button instead of show/hide on these
devices.
2015-06-16 22:41:29 +02:00
Solly 539955ff27 Merge pull request #497 from MOZGIII/MOZGIII-patch-vnc-auto-fix
Fixed incorrect UI usage and minor updateState params errors in vnc_auto.html
2015-06-12 14:34:34 -04:00
MOZGIII 2bcfd58667 Fixed incorrect UI usage and minor updateState params errors in vnc_auto.html 2015-06-12 20:41:41 +03:00
samhed 1138bdd4b7 Reverting most of commit cb3e4de. The issue was not related to using keyboardinputReset.. the issue was infact a typo which was introduced in 3b8ec46. I must be too tired.. 2015-05-19 13:34:50 +02:00
samhed cb3e4deb73 Stop using keyboardinputReset at the start of keyInput
* This fixes backspace when using the on-screen keyboard on Android
2015-05-19 12:44:30 +02:00
Samuel 613f05eea0 Update LICENSE.txt
Removed old no longer existing vnc.js and added playback.js
2015-05-05 13:13:17 +02:00
Samuel 8af9b6910c Merge pull request #483 from fabian-z/master
Make noVNC compatible with Content Security Policies
2015-05-04 12:17:30 +02:00
Fabian Zaremba 48d26b2d47 Move #keyboardinput declarations to base.css/ui.js 2015-05-04 12:11:30 +02:00
samhed 8ce27ddb4b Re-fixes #428 which was broken by commit 58ded70
* Disable local cursor when the browser doesn't support data uri
2015-04-29 14:54:28 +02:00
Solly f9ffb21b6b Merge pull request #415 from jimdigriz/fixes
slip in PATH for 'npm test' as not everyone has karma
2015-04-07 14:29:46 -04:00
Solly cd1ab146bb Merge pull request #474 from kanaka/bug/throw-error-from-constructor
Throw exceptions from RFB constructor
2015-03-27 13:23:32 -04:00
Solly 245dc8669b Merge pull request #475 from kanaka/bug/follow-symlinks-for-here
Follow symbolic links in launch.sh
2015-03-27 11:54:39 -04:00
Solly Ross d9fc1c7be4 Throw exceptions from RFB constructor
Previously, if an error was thrown from the Display constructor
in the RFB constructor, we would attempt to use `RFB#updateState`
to handle this.  However, `RFB#updateState` attempts to close
the WebSocket connection, which doesn't exist at this point.

In the constructor, it's probably just better to raise an exception
instead (making sure to clean up anything relevant).

Fixes #460
2015-03-26 17:10:24 -04:00
Solly Ross 58ded70d15 Create RFB object on connect
In e543525faa, we switched to creating
a new RFB object on disconnect.  This caused issues, however, since
any errors were only displayed briefly before the new "loaded" text
was displayed instead.

Now, we create the RFB object on connect.  This essentially removes
the usefulness of the "loaded" state, but prevents the aforementioned
problem.

To facilitate this, the code which does detection of cursor URI support
was moved from this Display constructor (which now calls the new
function) into its own function, `Util.browserSupportsCursorURIs()`.

Fixes #467
2015-03-26 17:09:05 -04:00
Solly Ross 2ace90e6d5 Follow symbolic links in launch.sh
Previously, in launch.sh, `$HERE` was the directory of `$0`.
However, if `$0` was actually a symlink, `$HERE` would be
wherever the symlink was, which could cause issues (for
example, the script wouldn't be able to local `$WEB` or
`$WEBSOCKIFY` properly).

Now, `$HERE` looks at whatever `$0` points at instead.

Closes #447.
2015-03-26 16:57:17 -04:00
samhed 16b3ef77d1 Make getCanvasLimit more efficient by only calling getPosition once. 2015-03-11 07:29:30 +01:00
Solly cefc9a9177 Merge pull request #464 from kanaka/bug/firefoxresize
Fix resize in Firefox on Android
2015-03-10 17:13:21 -04:00
samhed fdedbafb1d * Don't check specific html elements from the display code (Fixes #446)
* Renamed and reworked fbuClip to clippingDisplay
* Added tests for clippingDisplay
* Use the a noVNC_container which covers the entire page to get the full size
  (Fixes #463)
* Added maxWidth and maxHeight to the canvas which can limit the viewport size
* Only show either the canvas or the logo, hide one when the other is shown
* Always center the canvas (previously it was only centered when not clipping)
* Removed iOS specific "position-fixed" fixes and start calling setBarPosition
  on every resize
* Removed the noVNC_screen_pad
2015-03-09 14:30:56 +01:00
samhed 798340b98d * Change name of ext_desktop_size to the proper ExtendedDesktopSize
* Added better error handling in ExtendedDesktopSize
* Added helper function to share code with DesktopSize
* Update test.rfb.js to only check for error handling if we were the
  ones requesting the resize
2015-03-05 14:56:47 +01:00
samhed 3b8ec46fd2 Make the touch-keyboard code more robust through verifying that global variables are set before use. 2015-03-05 09:54:56 +01:00
Samuel 205d1a11ce Merge pull request #451 from kanaka/feature/scaling
Introduce Local Autoscaling
2015-03-05 09:52:10 +01:00
Solly Ross 72747869a7 Support local scaling
This commit adds two new addition scaling options.  Both options do
local scaling.  The first "Local Scaling", does both upscaling and
downscaling.  The second option, "Local Downscaling", only downscales.

This is based on work by @mightypenguin (with an additional bug
reported by @glazik12).
2015-03-03 13:15:49 -05:00
Solly Ross 8b46c0deb0 Update UI to allow for different scaling modes
This commit updates the UI to allow for different
scaling modes.  The "resize" option was changed to
be a dropdown with the following options: "None" (nothing),
"Remote Resizing" (SetDesktopSize).
2015-02-27 17:13:51 -05:00