-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support the 'ExtendedDesktopSize' and the 'SetDesktopSize' encodings #271
Closed
Closed
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0bb4537
automatically resizes the noVNC session to fit the browser window, so…
samhed b0871c1
fixed some errors in the logic from my last commit, also some minor i…
samhed bcf3b08
Additional fixes for the code in my previous commits:
samhed 9a6bcce
Merge branch 'master' of https://github.com/kanaka/noVNC
samhed 4579940
Merge branch 'master' of https://github.com/kanaka/noVNC
samhed 01f9d2e
Merge branch 'master' of https://github.com/kanaka/noVNC
samhed 21256e9
Small fix for deducting the correct number of pixels from the height …
samhed 359f88a
Fixed a bug which sometimes occured on touch devices.
samhed 0ac6c31
Added the automatic resize functionality for vnc_auto.html.
samhed af82a2c
Merge branch 'master' of https://github.com/kanaka/noVNC
samhed e894bf7
TESTING, TO BE REMOVED
samhed 6f4310e
Revert "TESTING, TO BE REMOVED"
samhed 9ae9fde
Merge to keep up to date with upstream
samhed 8bb048c
Make sure to take the clipping setting into account and do show scrol…
samhed dd54a45
Fixed merge-errors
samhed 1f57d1e
Hide the view_drag_button (the hand) when the display area is the sam…
samhed 87002c8
Split viewportChange into viewportChangePos and viewportChangeSize to…
samhed 9b9ead6
removed duplicate code in vnc_auto
samhed 9891d8a
noVNC-control-bar doesn't exist in vnc_auto.html, check noVNC_status_…
samhed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,18 @@ | |
"input.js", "display.js", "jsunzip.js", "rfb.js"]); | ||
|
||
var rfb; | ||
var resizeTimeout; | ||
|
||
|
||
function UIresize() { | ||
// Control-bar height: 36px + | ||
// border height: 5px = 41px to be deducted from the height | ||
rfb.setDesktopSize(window.innerWidth, window.innerHeight - 41); | ||
} | ||
function FBUComplete(rfb, fbu) { | ||
UIresize(); | ||
rfb.set_onFBUComplete(function() { }); | ||
} | ||
function passwordRequired(rfb) { | ||
var msg; | ||
msg = '<form onsubmit="return setPassword();"'; | ||
|
@@ -113,6 +124,16 @@ | |
} | ||
} | ||
|
||
window.onresize = function () { | ||
// When the window has been resized, wait until the size remains | ||
// the same for 0.5 seconds before sending the request for changing | ||
// the resolution of the session | ||
clearTimeout(resizeTimeout); | ||
resizeTimeout = setTimeout(function(){ | ||
UIresize(); | ||
}, 500); | ||
}; | ||
|
||
window.onscriptsload = function () { | ||
var host, port, password, path, token; | ||
|
||
|
@@ -161,7 +182,8 @@ | |
'shared': WebUtil.getQueryVar('shared', true), | ||
'view_only': WebUtil.getQueryVar('view_only', false), | ||
'updateState': updateState, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should still be onUpdateState (otherwise the status bar doesn't function correctly) |
||
'onPasswordRequired': passwordRequired}); | ||
'onPasswordRequired': passwordRequired, | ||
'onFBUComplete': FBUComplete}); | ||
rfb.connect(host, port, password, path); | ||
}; | ||
</script> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this change breaks the viewport pan function.. @kanaka do you have a quick explanation? Otherwise I will keep digging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's doesn't work on my project,i used libvirt in centos,javascript in the browser,i just can't let the vnc's width&height follow the browser change.could u help me?thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.. first of all you need a VNC server which supports the ExtendedDesktopSize encoding. Then you need the functionality that this PR is supposed to give. As I mentioned here, this function works but sadly it breaks the viewport pan function.