CopyRect artifacts, fix unload detection on iframes
This commit is contained in:
parent
bc177da7eb
commit
2b7f938c6e
|
@ -166,8 +166,8 @@ const UI = {
|
||||||
UI.hideKeyboardControls();
|
UI.hideKeyboardControls();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener("beforeunload", (e) => {
|
window.addEventListener("unload", (e) => {
|
||||||
if (UI.rfb) {
|
if (UI.rfb) {
|
||||||
UI.disconnect();
|
UI.disconnect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,10 @@ const UI = {
|
||||||
//Render default UI
|
//Render default UI
|
||||||
start() {
|
start() {
|
||||||
console.log('start')
|
console.log('start')
|
||||||
window.addEventListener("beforeunload", (e) => {
|
window.addEventListener("unload", (e) => {
|
||||||
if (UI.rfb) {
|
if (UI.rfb) {
|
||||||
UI.disconnect();
|
UI.disconnect();
|
||||||
}
|
}
|
||||||
console.log('beforeunload')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,4 +311,4 @@ const UI = {
|
||||||
|
|
||||||
UI.prime();
|
UI.prime();
|
||||||
|
|
||||||
export default UI;
|
export default UI;
|
||||||
|
|
|
@ -1685,6 +1685,7 @@ export default class RFB extends EventTargetMixin {
|
||||||
this._display.addScreen(event.data.screenID, event.data.width, event.data.height, event.data.pixelRatio, event.data.containerHeight, event.data.containerWidth);
|
this._display.addScreen(event.data.screenID, event.data.width, event.data.height, event.data.pixelRatio, event.data.containerHeight, event.data.containerWidth);
|
||||||
const size = this._screenSize();
|
const size = this._screenSize();
|
||||||
RFB.messages.setDesktopSize(this._sock, size, this._screenFlags);
|
RFB.messages.setDesktopSize(this._sock, size, this._screenFlags);
|
||||||
|
this._sendEncodings();
|
||||||
this._updateContinuousUpdates();
|
this._updateContinuousUpdates();
|
||||||
this.dispatchEvent(new CustomEvent("screenregistered", {}));
|
this.dispatchEvent(new CustomEvent("screenregistered", {}));
|
||||||
Log.Info(`Secondary monitor (${event.data.screenID}) has been registered.`);
|
Log.Info(`Secondary monitor (${event.data.screenID}) has been registered.`);
|
||||||
|
@ -1702,6 +1703,7 @@ export default class RFB extends EventTargetMixin {
|
||||||
Log.Info(`Secondary monitor (${event.data.screenID}) has been removed.`);
|
Log.Info(`Secondary monitor (${event.data.screenID}) has been removed.`);
|
||||||
const size = this._screenSize();
|
const size = this._screenSize();
|
||||||
RFB.messages.setDesktopSize(this._sock, size, this._screenFlags);
|
RFB.messages.setDesktopSize(this._sock, size, this._screenFlags);
|
||||||
|
this._sendEncodings();
|
||||||
this._updateContinuousUpdates();
|
this._updateContinuousUpdates();
|
||||||
this.dispatchEvent(new CustomEvent("screenregistered", {}));
|
this.dispatchEvent(new CustomEvent("screenregistered", {}));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2859,7 +2861,10 @@ export default class RFB extends EventTargetMixin {
|
||||||
const encs = [];
|
const encs = [];
|
||||||
|
|
||||||
// In preference order
|
// In preference order
|
||||||
encs.push(encodings.encodingCopyRect);
|
// Disable copyrect when using multiple displays
|
||||||
|
if (this._display.screens.length === 1) {
|
||||||
|
encs.push(encodings.encodingCopyRect);
|
||||||
|
}
|
||||||
// Only supported with full depth support
|
// Only supported with full depth support
|
||||||
if (this._fbDepth == 24) {
|
if (this._fbDepth == 24) {
|
||||||
encs.push(encodings.encodingTight);
|
encs.push(encodings.encodingTight);
|
||||||
|
|
Loading…
Reference in New Issue