public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH] fix #5063: load webgl addon in try block
@ 2023-12-11 10:19 Dominik Csapak
  2023-12-11 12:39 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-12-11 10:19 UTC (permalink / raw)
  To: pve-devel

since under certain circumstances (e.g. using safari < 16) the addon
constructor already throws an exception, not only the loading later.

To allow falling back to the canvas renderer, move it into the try block
after webgl detection.

This should fix the xterm.js console on iOS in chrome and other
browsers.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 xterm.js/src/main.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xterm.js/src/main.js b/xterm.js/src/main.js
index 1575697..289032c 100644
--- a/xterm.js/src/main.js
+++ b/xterm.js/src/main.js
@@ -99,7 +99,6 @@ var terminalContainer = document.getElementById('terminal-container');
 document.getElementById('status_bar').addEventListener('click', hideMsg);
 document.getElementById('connect_btn').addEventListener('click', startGuest);
 const fitAddon = new FitAddon.FitAddon();
-const webglAddon = new WebglAddon.WebglAddon();
 
 createTerminal();
 
@@ -157,6 +156,7 @@ function createTerminal() {
     let loadedWebgl = false;
     try {
 	if (detectWebgl()) {
+	    const webglAddon = new WebglAddon.WebglAddon();
 	    term.loadAddon(webglAddon);
 	    loadedWebgl = true;
 	}
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH] fix #5063: load webgl addon in try block
  2023-12-11 10:19 [pve-devel] [PATCH] fix #5063: load webgl addon in try block Dominik Csapak
@ 2023-12-11 12:39 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-12-11 12:39 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 11/12/2023 um 11:19 schrieb Dominik Csapak:
> since under certain circumstances (e.g. using safari < 16) the addon
> constructor already throws an exception, not only the loading later.
> 
> To allow falling back to the canvas renderer, move it into the try block
> after webgl detection.
> 
> This should fix the xterm.js console on iOS in chrome and other
> browsers.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  xterm.js/src/main.js | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-11 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 10:19 [pve-devel] [PATCH] fix #5063: load webgl addon in try block Dominik Csapak
2023-12-11 12:39 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal