Skip to content

Commit 4db2735

Browse files
committed
Bugfix: Split windows now remember their original size.
1 parent c1ab2ed commit 4db2735

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/contents/ui/AutoTiler.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ QtObject {
10031003

10041004
function toggleAutoTile(window, tiler = -1) {
10051005
if (window.mt_auto == undefined) {
1006-
window.mt_originalSize = {xOffset: 0, x: window.x, y: window.y, width: window.width, height: window.height};
1006+
window.mt_originalSize = {x: window.x, y: window.y, width: window.width, height: window.height};
10071007
let currentMapping = getMappingForWindow(window);
10081008
let configIndex = tiler != -1 ? tiler : (currentMapping.autoTilerIndex != -1 ? currentMapping.autoTilerIndex : 0);
10091009
let insertIndex = autoLayoutConfigs[configIndex].autoTileIndex;

src/contents/ui/main.qml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ SPECIAL_AUTO_TILER_3`;
806806
windowCursor = Qt.point(client.x + client.width / 2, client.y);
807807
}
808808
if ((config.restoreSize || autoTiler.configAutoTileRestoreSize && client.mt_auto) && client.mt_originalSize) {
809-
client.frameGeometry = Qt.rect(getCursorPosition().x - client.mt_originalSize.xOffset, client.frameGeometry.y, client.mt_originalSize.width, client.mt_originalSize.height);
809+
client.frameGeometry = Qt.rect(getCursorPosition().x, client.frameGeometry.y, client.mt_originalSize.width, client.mt_originalSize.height);
810810
delete client.mt_originalSize;
811811
}
812812
positionAtMoveStart = {x: client.x, y: client.y};
@@ -891,8 +891,7 @@ SPECIAL_AUTO_TILER_3`;
891891
} else {
892892
var geometry = currentTiler.getGeometry();
893893
if (geometry != null) {
894-
let xOffset = (getCursorPosition().x - client.x) / client.width;
895-
client.mt_originalSize = {xOffset: xOffset, x: client.x, y: client.y, width: client.width, height: client.height};
894+
client.mt_originalSize = {x: client.x, y: client.y, width: client.width, height: client.height};
896895

897896
switch (geometry.special) {
898897
case 'SPECIAL_FILL':
@@ -1035,6 +1034,9 @@ SPECIAL_AUTO_TILER_3`;
10351034
addMargins(geometryFirst, false, true, false, false);
10361035
addMargins(geometrySecond, true, false, false, false);
10371036
}
1037+
if (!window.mt_originalSize) {
1038+
window.mt_originalSize = {x: window.x, y: window.y, width: window.width, height: window.height};
1039+
}
10381040
moveAndResizeWindow(window, leftOrTop ? geometrySecond : geometryFirst);
10391041
}
10401042

0 commit comments

Comments
 (0)