diff --git a/app/ui.js b/app/ui.js index 52078856..7f9bc04a 100644 --- a/app/ui.js +++ b/app/ui.js @@ -1084,11 +1084,11 @@ var UI; display.set_maxWidth(screen.w); display.set_maxHeight(screen.h); - Util.Debug('Attempting requestDesktopSize(' + - screen.w + ', ' + screen.h + ')'); - // 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); } else if (resizeMode === 'scale' || resizeMode === 'downscale') { diff --git a/core/rfb.js b/core/rfb.js index 4a5f4344..7f8ae6d0 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -339,12 +339,18 @@ // Requests a change of remote desktop size. This message is an extension // and may only be sent if we have received an ExtendedDesktopSize message requestDesktopSize: function (width, height) { - if (this._rfb_connection_state !== 'connected') { return; } + if (this._rfb_connection_state !== 'connected' || + this._view_only) { + return; + } if (this._supportsSetDesktopSize) { RFB.messages.setDesktopSize(this._sock, width, height, this._screen_id, this._screen_flags); this._sock.flush(); + return true; + } else { + return false; } },