From 7ae53db9cd8ed063b1f603a135949a13129c5004 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Thu, 1 Sep 2016 15:35:31 +0200 Subject: [PATCH] Don't request a new desktop size in view_only --- app/ui.js | 8 ++++---- core/rfb.js | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) 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; } },