Don't request a new desktop size in view_only

This commit is contained in:
Samuel Mannehed 2016-09-01 15:35:31 +02:00
parent 81bd2d6682
commit 7ae53db9cd
2 changed files with 11 additions and 5 deletions

View File

@ -1084,11 +1084,11 @@ var UI;
display.set_maxWidth(screen.w); display.set_maxWidth(screen.w);
display.set_maxHeight(screen.h); display.set_maxHeight(screen.h);
Util.Debug('Attempting requestDesktopSize(' +
screen.w + ', ' + screen.h + ')');
// Request a remote size covering the viewport // Request a remote size covering the viewport
UI.rfb.requestDesktopSize(screen.w, screen.h); if (UI.rfb.requestDesktopSize(screen.w, screen.h)) {
Util.Debug('Requested new desktop size: ' +
screen.w + 'x' + screen.h);
}
}, 500); }, 500);
} else if (resizeMode === 'scale' || resizeMode === 'downscale') { } else if (resizeMode === 'scale' || resizeMode === 'downscale') {

View File

@ -339,12 +339,18 @@
// Requests a change of remote desktop size. This message is an extension // Requests a change of remote desktop size. This message is an extension
// and may only be sent if we have received an ExtendedDesktopSize message // and may only be sent if we have received an ExtendedDesktopSize message
requestDesktopSize: function (width, height) { requestDesktopSize: function (width, height) {
if (this._rfb_connection_state !== 'connected') { return; } if (this._rfb_connection_state !== 'connected' ||
this._view_only) {
return;
}
if (this._supportsSetDesktopSize) { if (this._supportsSetDesktopSize) {
RFB.messages.setDesktopSize(this._sock, width, height, RFB.messages.setDesktopSize(this._sock, width, height,
this._screen_id, this._screen_flags); this._screen_id, this._screen_flags);
this._sock.flush(); this._sock.flush();
return true;
} else {
return false;
} }
}, },