Allow view_only to be changed while connected
This commit is contained in:
parent
f78a652e86
commit
ef1e8bab22
|
@ -424,6 +424,7 @@ var UI;
|
|||
UI.addSettingChangeHandler('clip', UI.updateViewClip);
|
||||
UI.addSettingChangeHandler('shared');
|
||||
UI.addSettingChangeHandler('view_only');
|
||||
UI.addSettingChangeHandler('view_only', UI.updateViewOnly);
|
||||
UI.addSettingChangeHandler('host');
|
||||
UI.addSettingChangeHandler('port');
|
||||
UI.addSettingChangeHandler('path');
|
||||
|
@ -506,7 +507,6 @@ var UI;
|
|||
|
||||
UI.enableDisableViewClip();
|
||||
document.getElementById('noVNC_setting_shared').disabled = UI.connected;
|
||||
document.getElementById('noVNC_setting_view_only').disabled = UI.connected;
|
||||
document.getElementById('noVNC_setting_host').disabled = UI.connected;
|
||||
document.getElementById('noVNC_setting_port').disabled = UI.connected;
|
||||
document.getElementById('noVNC_setting_path').disabled = UI.connected;
|
||||
|
@ -1065,9 +1065,10 @@ var UI;
|
|||
UI.rfb.set_true_color(UI.getSetting('true_color'));
|
||||
UI.rfb.set_local_cursor(UI.getSetting('cursor'));
|
||||
UI.rfb.set_shared(UI.getSetting('shared'));
|
||||
UI.rfb.set_view_only(UI.getSetting('view_only'));
|
||||
UI.rfb.set_repeaterID(UI.getSetting('repeaterID'));
|
||||
|
||||
UI.updateViewOnly();
|
||||
|
||||
UI.rfb.connect(host, port, password, path);
|
||||
},
|
||||
|
||||
|
@ -1655,6 +1656,10 @@ var UI;
|
|||
}
|
||||
},
|
||||
|
||||
updateViewOnly: function() {
|
||||
UI.rfb.set_view_only(UI.getSetting('view_only'));
|
||||
},
|
||||
|
||||
updateLogging: function() {
|
||||
WebUtil.init_logging(UI.getSetting('logging'));
|
||||
},
|
||||
|
|
15
core/rfb.js
15
core/rfb.js
|
@ -1490,6 +1490,21 @@
|
|||
}
|
||||
};
|
||||
|
||||
RFB.prototype.set_view_only = function (view_only) {
|
||||
this._view_only = view_only;
|
||||
|
||||
if (this._rfb_connection_state === "connecting" ||
|
||||
this._rfb_connection_state === "connected") {
|
||||
if (view_only) {
|
||||
this._keyboard.ungrab();
|
||||
this._mouse.ungrab();
|
||||
} else {
|
||||
this._keyboard.grab();
|
||||
this._mouse.grab();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
RFB.prototype.get_display = function () { return this._display; };
|
||||
RFB.prototype.get_keyboard = function () { return this._keyboard; };
|
||||
RFB.prototype.get_mouse = function () { return this._mouse; };
|
||||
|
|
Loading…
Reference in New Issue