KASM-5523 change resize settings if admin prohibited on server (#93)
* KASM-5523 change resize settings if admin prohibited on server * Fix local scaling aspect ratio * fix exception on reconnect * Always recalculate resolution on setting changes --------- Co-authored-by: mattmcclaskey <matt@kasmweb.com>
This commit is contained in:
parent
7ce3f140f5
commit
4c6127b47b
|
@ -2922,7 +2922,7 @@ const UI = {
|
||||||
if (e && e.detail) {
|
if (e && e.detail) {
|
||||||
const { left, top, screenID } = e.detail
|
const { left, top, screenID } = e.detail
|
||||||
const current = screenPlan.screens.findIndex(el => el.screenID === screenID)
|
const current = screenPlan.screens.findIndex(el => el.screenID === screenID)
|
||||||
if (current) {
|
if (current > -1) {
|
||||||
screenPlan.screens[current].x = left
|
screenPlan.screens[current].x = left
|
||||||
screenPlan.screens[current].y = top
|
screenPlan.screens[current].y = top
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ export default class Display {
|
||||||
this._screens[i].width = Math.floor(width * clientServerRatioW);
|
this._screens[i].width = Math.floor(width * clientServerRatioW);
|
||||||
this._screens[i].serverWidth = width;
|
this._screens[i].serverWidth = width;
|
||||||
this._screens[i].serverHeight = height;
|
this._screens[i].serverHeight = height;
|
||||||
this._screens[i].scale = this._screens[i].width / this._screens[i].serverWidth;
|
this._screens[i].scale = Math.min(clientServerRatioH, clientServerRatioW);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < this._screens.length; i++) {
|
for (i = 0; i < this._screens.length; i++) {
|
||||||
|
|
11
core/rfb.js
11
core/rfb.js
|
@ -845,6 +845,7 @@ export default class RFB extends EventTargetMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._pendingApplyResolutionChange) {
|
if (this._pendingApplyResolutionChange) {
|
||||||
|
this._screenSize();
|
||||||
// Scaling trumps clipping, so we may need to adjust
|
// Scaling trumps clipping, so we may need to adjust
|
||||||
// clipping when enabling or disabling scaling
|
// clipping when enabling or disabling scaling
|
||||||
if (this._scaleViewport && this._clipViewport) {
|
if (this._scaleViewport && this._clipViewport) {
|
||||||
|
@ -860,7 +861,6 @@ export default class RFB extends EventTargetMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._resizeSession || (this._forcedResolutionX && this._forcedResolutionY)) {
|
if (this._resizeSession || (this._forcedResolutionX && this._forcedResolutionY)) {
|
||||||
this._screenSize();
|
|
||||||
this.dispatchEvent(new CustomEvent("screenregistered", {}));
|
this.dispatchEvent(new CustomEvent("screenregistered", {}));
|
||||||
clearTimeout(this._resizeTimeout);
|
clearTimeout(this._resizeTimeout);
|
||||||
this._resizeTimeout = setTimeout(this._requestRemoteResize.bind(this), 500);
|
this._resizeTimeout = setTimeout(this._requestRemoteResize.bind(this), 500);
|
||||||
|
@ -2045,10 +2045,7 @@ export default class RFB extends EventTargetMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
Log.Debug("Mouse left Window");
|
|
||||||
Log.Debug(ev);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleMouse(ev) {
|
_handleMouse(ev) {
|
||||||
|
@ -4124,6 +4121,10 @@ export default class RFB extends EventTargetMixin {
|
||||||
switch (this._FBU.y) {
|
switch (this._FBU.y) {
|
||||||
case 1:
|
case 1:
|
||||||
msg = "Resize is administratively prohibited";
|
msg = "Resize is administratively prohibited";
|
||||||
|
this._resizeSession = false;
|
||||||
|
this._clipViewport = false;
|
||||||
|
this._scaleViewport = false;
|
||||||
|
this.updateConnectionSettings();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
msg = "Out of resources";
|
msg = "Out of resources";
|
||||||
|
|
Loading…
Reference in New Issue