]> git.proxmox.com Git - novnc-pve.git/blame - debian/patches/0003-change-scaling-when-toggling-fullscreen.patch
rebase patches on v1.1.0
[novnc-pve.git] / debian / patches / 0003-change-scaling-when-toggling-fullscreen.patch
CommitLineData
2b8dde16 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
fe91e9e1
DC
2From: Dominik Csapak <d.csapak@proxmox.com>
3Date: Thu, 11 May 2017 10:34:10 +0200
2b8dde16 4Subject: [PATCH 03/12] change scaling when toggling fullscreen
fe91e9e1
DC
5
6when activating fullscreen, we change the scaling to 'scale',
7and changing it back when leaving fullscreen
8
9Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10---
4cc9ed08
DC
11 app/ui.js | 11 +++++++++++
12 1 file changed, 11 insertions(+)
fe91e9e1
DC
13
14diff --git a/app/ui.js b/app/ui.js
2b8dde16 15index 1b0f7aa..8cc6cfd 100644
fe91e9e1
DC
16--- a/app/ui.js
17+++ b/app/ui.js
2b8dde16 18@@ -1201,6 +1201,13 @@ const UI = {
fe91e9e1
DC
19 } else if (document.msExitFullscreen) {
20 document.msExitFullscreen();
21 }
22+
a375b7e5
DC
23+ // when changing from fullscreen to window,
24+ // re enable auto resize
4cc9ed08
DC
25+ if (WebUtil.getQueryVar('resize') !== 'scale') {
26+ UI.forceSetting('resize', 'off');
27+ UI.enableSetting('resize');
a375b7e5 28+ }
fe91e9e1
DC
29 } else {
30 if (document.documentElement.requestFullscreen) {
31 document.documentElement.requestFullscreen();
2b8dde16 32@@ -1211,7 +1218,11 @@ const UI = {
fe91e9e1
DC
33 } else if (document.body.msRequestFullscreen) {
34 document.body.msRequestFullscreen();
35 }
a375b7e5 36+ // we want scaling in fullscreen mode
4cc9ed08
DC
37+ UI.forceSetting('resize', 'scale');
38+ UI.enableSetting('resize');
fe91e9e1 39 }
a375b7e5 40+ UI.applyResizeMode();
fe91e9e1 41 UI.updateFullscreenButton();
a375b7e5 42 },
2b8dde16 43