From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 346ED858DA for ; Mon, 20 Dec 2021 12:33:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 227C11BEA9 for ; Mon, 20 Dec 2021 12:33:03 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id D38AC1BE9E for ; Mon, 20 Dec 2021 12:33:01 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id A9F524473A for ; Mon, 20 Dec 2021 12:33:01 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Mon, 20 Dec 2021 12:33:00 +0100 Message-Id: <20211220113300.3090910-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.169 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH novnc] add patches to workaround fullscreen issue in android app X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2021 11:33:33 -0000 patch 15 hides the fullscreen button, patch 16 make the error message dismissable Signed-off-by: Dominik Csapak --- ...-button-on-isFullscreen-get-variable.patch | 39 +++++++++++++++ debian/patches/0017-make-error-hideable.patch | 47 +++++++++++++++++++ debian/patches/series | 2 + 3 files changed, 88 insertions(+) create mode 100644 debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch create mode 100644 debian/patches/0017-make-error-hideable.patch diff --git a/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch b/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch new file mode 100644 index 0000000..1cdafd2 --- /dev/null +++ b/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dominik Csapak +Date: Mon, 20 Dec 2021 09:28:35 +0100 +Subject: [PATCH] hide fullscreen button on 'isFullscreen' get variable + +workaround for android app, since the webview does not allow +'requestFullscreen' apparently, so we make the webview fullscreen and +hide the button here. + +Signed-off-by: Dominik Csapak +--- + app/pve.js | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/app/pve.js b/app/pve.js +index 486bd5c..042eb7c 100644 +--- a/app/pve.js ++++ b/app/pve.js +@@ -12,6 +12,7 @@ export default function PVEUI(UI){ + this.nodename = WebUtil.getQueryVar('node'); + this.resize = WebUtil.getQueryVar('resize'); + this.cmd = WebUtil.getQueryVar('cmd'); ++ this.fullscreen = WebUtil.getQueryVar('isFullscreen'); + this.lastFBWidth = undefined; + this.lastFBHeight = undefined; + this.sizeUpdateTimer = undefined; +@@ -304,6 +305,12 @@ PVEUI.prototype = { + .classList.add('pve_hidden'); + } + ++ // hide fullscren button when it's already fullscreen (e.g. android app) ++ if (me.fullscreen) { ++ document.getElementById('noVNC_fullscreen_button') ++ .classList.add('pve_hidden'); ++ } ++ + // add command logic + var commandArray = [ + { cmd: 'start', kvm: 1, lxc: 1}, diff --git a/debian/patches/0017-make-error-hideable.patch b/debian/patches/0017-make-error-hideable.patch new file mode 100644 index 0000000..9322ade --- /dev/null +++ b/debian/patches/0017-make-error-hideable.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dominik Csapak +Date: Mon, 20 Dec 2021 09:34:36 +0100 +Subject: [PATCH] make error hideable + +by clicking on it + +Signed-off-by: Dominik Csapak +--- + app/error-handler.js | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/app/error-handler.js b/app/error-handler.js +index 81a6cba..6ce8013 100644 +--- a/app/error-handler.js ++++ b/app/error-handler.js +@@ -15,6 +15,18 @@ + + (function _scope() { + "use strict"; ++ function hideError() { ++ const msg = document.getElementById('noVNC_fallback_errormsg'); ++ ++ // close it ++ document.getElementById('noVNC_fallback_error') ++ .classList.remove("noVNC_open"); ++ ++ // remove all children ++ while (msg.firstChild) { ++ msg.removeChild(msg.firstChild); ++ } ++ } + + // Fallback for all uncought errors + function handleError(event, err) { +@@ -52,8 +64,9 @@ + msg.appendChild(div); + } + +- document.getElementById('noVNC_fallback_error') +- .classList.add("noVNC_open"); ++ const node = document.getElementById('noVNC_fallback_error'); ++ node.classList.add("noVNC_open"); ++ node.onclick = hideError; + } catch (exc) { + document.write("noVNC encountered an error."); + } diff --git a/debian/patches/series b/debian/patches/series index 4913924..a520e27 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -13,3 +13,5 @@ 0013-Revert-Remove-the-default-value-of-wsProtocols.patch 0014-avoid-passing-deprecated-upgrade-parameter.patch 0015-create-own-class-for-hidden-buttons.patch +0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch +0017-make-error-hideable.patch -- 2.30.2