@@ -25,6 +25,9 @@ window.updateSetting = (name, value) => {
25
25
}
26
26
}
27
27
28
+ import '@interactjs/pointer-events'
29
+ import '@interactjs/actions/drag'
30
+ import interact from '@interactjs/interact' ;
28
31
import "core-js/stable" ;
29
32
import "regenerator-runtime/runtime" ;
30
33
import * as Log from '../core/util/logging.js' ;
@@ -67,6 +70,7 @@ const UI = {
67
70
selectedMonitor : null ,
68
71
refreshRotation : 0 ,
69
72
currentDisplay : null ,
73
+ displayWindows : [ 'primary' ] ,
70
74
71
75
supportsBroadcastChannel : ( typeof BroadcastChannel !== "undefined" ) ,
72
76
@@ -84,7 +88,13 @@ const UI = {
84
88
85
89
// Render default UI and initialize settings menu
86
90
start ( ) {
87
- //initialize settings then apply quality presents
91
+
92
+ // If secondary monitor skip init
93
+ if ( window . location . href . includes ( "screen.html" ) ) {
94
+ return ;
95
+ }
96
+
97
+ // Initialize settings then apply quality presents
88
98
UI . initSettings ( ) ;
89
99
UI . updateQuality ( ) ;
90
100
@@ -265,6 +275,7 @@ const UI = {
265
275
UI . initSetting ( 'prefer_local_cursor' , true ) ;
266
276
UI . initSetting ( 'toggle_control_panel' , false ) ;
267
277
UI . initSetting ( 'enable_perf_stats' , false ) ;
278
+ UI . initSetting ( 'enable_threading' , true ) ;
268
279
UI . initSetting ( 'virtual_keyboard_visible' , false ) ;
269
280
UI . initSetting ( 'enable_ime' , false ) ;
270
281
UI . initSetting ( 'enable_webrtc' , false ) ;
@@ -529,6 +540,7 @@ const UI = {
529
540
UI . addClickHandle ( 'noVNC_settings_button' , UI . toggleSettingsPanel ) ;
530
541
531
542
document . getElementById ( "noVNC_setting_enable_perf_stats" ) . addEventListener ( 'click' , UI . showStats ) ;
543
+ document . getElementById ( "noVNC_setting_enable_threading" ) . addEventListener ( 'click' , UI . threading ) ;
532
544
document . getElementById ( "noVNC_auto_placement" ) . addEventListener ( 'change' , UI . setAutoPlacement ) ;
533
545
534
546
UI . addSettingChangeHandler ( 'encrypt' ) ;
@@ -597,6 +609,8 @@ const UI = {
597
609
UI . addSettingChangeHandler ( 'enable_webrtc' , UI . toggleWebRTC ) ;
598
610
UI . addSettingChangeHandler ( 'enable_hidpi' ) ;
599
611
UI . addSettingChangeHandler ( 'enable_hidpi' , UI . enableHiDpi ) ;
612
+ UI . addSettingChangeHandler ( 'enable_threading' ) ;
613
+ UI . addSettingChangeHandler ( 'enable_threading' , UI . threading ) ;
600
614
} ,
601
615
602
616
addFullscreenHandlers ( ) {
@@ -742,6 +756,17 @@ const UI = {
742
756
743
757
} ,
744
758
759
+ threading ( ) {
760
+ if ( UI . rfb ) {
761
+ if ( UI . getSetting ( 'enable_threading' ) ) {
762
+ UI . rfb . threading = true ;
763
+ } else {
764
+ UI . rfb . threading = false ;
765
+ }
766
+ }
767
+ UI . saveSetting ( 'enable_threading' ) ;
768
+ } ,
769
+
745
770
showStatus ( text , statusType , time , kasm = false ) {
746
771
// If inside the full Kasm CDI framework, don't show messages unless explicitly told to
747
772
if ( WebUtil . isInsideKasmVDI ( ) && ! kasm ) {
@@ -1482,6 +1507,7 @@ const UI = {
1482
1507
UI . rfb . clipboardBinary = supportsBinaryClipboard ( ) && UI . rfb . clipboardSeamless ;
1483
1508
UI . rfb . enableWebRTC = UI . getSetting ( 'enable_webrtc' ) ;
1484
1509
UI . rfb . enableHiDpi = UI . getSetting ( 'enable_hidpi' ) ;
1510
+ UI . rfb . threading = UI . getSetting ( 'enable_threading' ) ;
1485
1511
UI . rfb . mouseButtonMapper = UI . initMouseButtonMapper ( ) ;
1486
1512
if ( UI . rfb . videoQuality === 5 ) {
1487
1513
UI . rfb . enableQOI = true ;
@@ -1792,6 +1818,10 @@ const UI = {
1792
1818
case 'control_displays' :
1793
1819
parent . postMessage ( { action : 'can_control_displays' , value : true } , '*' ) ;
1794
1820
break ;
1821
+ case 'enable_threading' :
1822
+ UI . forceSetting ( 'enable_threading' , event . data . value , false ) ;
1823
+ UI . threading ( ) ;
1824
+ break ;
1795
1825
case 'terminate' :
1796
1826
//terminate a session, different then disconnect in that it is assumed KasmVNC will be shutdown
1797
1827
if ( UI . rfb ) {
@@ -1892,6 +1922,7 @@ const UI = {
1892
1922
UI . rfb . videoQuality = UI . getSetting ( 'video_quality' ) ;
1893
1923
UI . rfb . enableWebP = UI . getSetting ( 'enable_webp' ) ;
1894
1924
UI . rfb . enableHiDpi = UI . getSetting ( 'enable_hidpi' ) ;
1925
+ UI . rfb . threading = UI . getSetting ( 'enable_threading' ) ;
1895
1926
1896
1927
if ( UI . rfb . resizeSession ) {
1897
1928
UI . rfb . forcedResolutionX = null ;
@@ -1982,8 +2013,9 @@ const UI = {
1982
2013
const current = UI . increaseCurrentDisplay ( details )
1983
2014
let screen = details . screens [ current ]
1984
2015
const options = 'left=' + screen . availLeft + ',top=' + screen . availTop + ',width=' + screen . availWidth + ',height=' + screen . availHeight + ',fullscreen'
1985
- window . open ( new_display_url , '_blank' , options ) ;
1986
- return
2016
+ let newdisplay = window . open ( new_display_url , '_blank' , options ) ;
2017
+ UI . displayWindows . push ( newdisplay ) ;
2018
+ return ;
1987
2019
}
1988
2020
} catch ( e ) {
1989
2021
console . log ( e )
@@ -1992,7 +2024,8 @@ const UI = {
1992
2024
}
1993
2025
1994
2026
Log . Debug ( `Opening a secondary display ${ new_display_url } ` )
1995
- window . open ( new_display_url , '_blank' , 'toolbar=0,location=0,menubar=0' ) ;
2027
+ let newdisplay = window . open ( new_display_url , '_blank' , 'toolbar=0,location=0,menubar=0' ) ;
2028
+ UI . displayWindows . push ( newdisplay ) ;
1996
2029
} ,
1997
2030
1998
2031
initMonitors ( screenPlan ) {
@@ -2545,6 +2578,7 @@ const UI = {
2545
2578
UI . rfb . videoQuality = parseInt ( UI . getSetting ( 'video_quality' ) ) ;
2546
2579
UI . rfb . enableQOI = enable_qoi ;
2547
2580
UI . rfb . enableHiDpi = UI . getSetting ( 'enable_hidpi' ) ;
2581
+ UI . rfb . threading = UI . getSetting ( 'enable_threading' ) ;
2548
2582
2549
2583
// Gracefully update settings server side
2550
2584
UI . rfb . updateConnectionSettings ( ) ;
0 commit comments