fix: new bug from combining resize and move commands - if window has min-size set and resize goes smaller window would not move or resize causing vesktop and steam to frequently break when in arrays on a smaller monitors
This commit is contained in:
@@ -119,6 +119,10 @@ export class WindowWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
actor.remove_all_transitions();
|
actor.remove_all_transitions();
|
||||||
|
|
||||||
|
// Move first to guarantee the window reaches the correct position even
|
||||||
|
// if the subsequent resize is clamped by minimum-size hints.
|
||||||
|
this._window.move_frame(true, rect.x, rect.y);
|
||||||
this._window.move_resize_frame(true, rect.x, rect.y, rect.width, rect.height);
|
this._window.move_resize_frame(true, rect.x, rect.y, rect.width, rect.height);
|
||||||
|
|
||||||
const new_rect = this._window.get_frame_rect();
|
const new_rect = this._window.get_frame_rect();
|
||||||
@@ -129,13 +133,27 @@ export class WindowWrapper {
|
|||||||
Math.abs(new_rect.height - rect.height) > WindowWrapper.RESIZE_TOLERANCE;
|
Math.abs(new_rect.height - rect.height) > WindowWrapper.RESIZE_TOLERANCE;
|
||||||
|
|
||||||
if (_retry > 0 && mismatch) {
|
if (_retry > 0 && mismatch) {
|
||||||
Logger.warn("RESIZE MISMATCH, retrying",
|
// If the window's actual size is larger than requested, it has a
|
||||||
`want(${rect.x},${rect.y},${rect.width},${rect.height})`,
|
// minimum-size constraint — retrying won't help. Just make sure
|
||||||
`got(${new_rect.x},${new_rect.y},${new_rect.width},${new_rect.height})`);
|
// it's at the correct position with its actual size.
|
||||||
queueEvent({
|
const sizeConstrained =
|
||||||
name: `delayed_resize_${this.getWindowId()}`,
|
new_rect.width > rect.width + WindowWrapper.RESIZE_TOLERANCE ||
|
||||||
callback: () => this.safelyResizeWindow(rect, _retry - 1),
|
new_rect.height > rect.height + WindowWrapper.RESIZE_TOLERANCE;
|
||||||
}, 50);
|
|
||||||
|
if (sizeConstrained) {
|
||||||
|
Logger.info("Window has min-size constraint, accepting actual size",
|
||||||
|
`want(${rect.x},${rect.y},${rect.width},${rect.height})`,
|
||||||
|
`actual(${new_rect.x},${new_rect.y},${new_rect.width},${new_rect.height})`);
|
||||||
|
this._window.move_frame(true, rect.x, rect.y);
|
||||||
|
} else {
|
||||||
|
Logger.warn("RESIZE MISMATCH, retrying",
|
||||||
|
`want(${rect.x},${rect.y},${rect.width},${rect.height})`,
|
||||||
|
`got(${new_rect.x},${new_rect.y},${new_rect.width},${new_rect.height})`);
|
||||||
|
queueEvent({
|
||||||
|
name: `delayed_resize_${this.getWindowId()}`,
|
||||||
|
callback: () => this.safelyResizeWindow(rect, _retry - 1),
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user