Skip to content

Commit 798d238

Browse files
committed
Added support for remembering Mouse Tiler auto tile status (enabled by default).
Will remember which auto tiler to use, and which tiles to restore when using the auto-tile feature of the Mouse Tiler.
1 parent 23a460d commit 798d238

4 files changed

Lines changed: 27 additions & 5 deletions

File tree

src/contents/config/main.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
<entry name="restoreResizedQuickTile" type="Bool">
3939
<default>false</default>
4040
</entry>
41+
<entry name="restoreMouseTiler" type="Bool">
42+
<default>true</default>
43+
</entry>
4144
<entry name="minimumCaptionMatch" type="Int">
4245
<default>0</default>
4346
<min>0</min>

src/contents/ui/config.ui

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>1188</width>
10-
<height>692</height>
10+
<height>738</height>
1111
</rect>
1212
</property>
1313
<layout class="QVBoxLayout" name="verticalLayout">
@@ -290,6 +290,13 @@
290290
</item>
291291
</layout>
292292
</item>
293+
<item>
294+
<widget class="QCheckBox" name="kcfg_restoreMouseTiler">
295+
<property name="text">
296+
<string>Restore Mouse Tiler auto tiler status. Will remember if a window was auto tiled or not. Make sure to increase the auto tile delay in Mouse Tiler settings to enable the restoration process</string>
297+
</property>
298+
</widget>
299+
</item>
293300
</layout>
294301
</widget>
295302
</item>

src/contents/ui/main.qml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Item {
158158
restoreWindowsWithoutCaption: KWin.readConfig("restoreWindowsWithoutCaption", true),
159159
restoreTile: KWin.readConfig("restoreTile", true),
160160
restoreResizedQuickTile: KWin.readConfig("restoreResizedQuickTile", false),
161+
restoreMouseTiler: KWin.readConfig("restoreMouseTiler", true),
161162
ignoreNumbers: KWin.readConfig("ignoreNumbers", true),
162163
minimumCaptionMatch: KWin.readConfig("minimumCaptionMatch", 0),
163164
multiMonitorType: KWin.readConfig("multiMonitorType", 0),
@@ -501,6 +502,14 @@ Item {
501502
zRestored = true;
502503
}
503504

505+
log('saveData.mouseTilerAuto: ' + saveData.mouseTilerAuto + ' config.restoreMouseTiler: ' + config.restoreMouseTiler + ' client.mt_autoRestore: ' + client.mt_autoRestore);
506+
if (saveData.mouseTilerAuto > 0 && config.restoreMouseTiler) {
507+
restoreMinimized = false;
508+
if (!client.mt_autoRestore) {
509+
client.mt_autoRestore = saveData.mouseTilerAuto;
510+
}
511+
}
512+
504513
// Restore minimized
505514
if (saveData.minimized && restoreMinimized) {
506515
log('Attempting to restore window minimized');
@@ -1166,7 +1175,8 @@ Item {
11661175
},
11671176
sessionRestore : false,
11681177
alreadyMatched : false,
1169-
tile : convertTileData(client)
1178+
tile : convertTileData(client),
1179+
mouseTilerAuto : (client.mt_autoRestore ? client.mt_autoRestore : 0)
11701180
};
11711181

11721182
if (debugLogs && client.tile) {
@@ -1503,7 +1513,8 @@ Item {
15031513
right : save.t.r, // right
15041514
top : save.t.t, // top
15051515
bottom : save.t.b // bottom
1506-
} : undefined
1516+
} : undefined,
1517+
mouseTilerAuto : save.o // mouseTilerAuto
15071518
// --- Omitted fields ---
15081519
// closeTime : // closeTime
15091520
// internalId : save.i // internalId
@@ -1576,7 +1587,8 @@ Item {
15761587
r: save.tile.right, // right
15771588
t: save.tile.top, // top
15781589
b: save.tile.bottom // bottom
1579-
} : undefined
1590+
} : undefined,
1591+
o: save.mouseTilerAuto // mouseTilerAuto
15801592
// --- Omitted fields ---
15811593
// : save.closeTime // closeTime
15821594
// i: save.internalId // internalId

src/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Description": "Save and restore application window positions (such as multi-window browsers)",
1111
"Icon": "preferences-desktop-virtual",
1212
"Id": "rememberwindowpositions",
13-
"Version": "5.2.1",
13+
"Version": "5.3.0",
1414
"License": "GPLv3",
1515
"Website": "https://github.com/rxappdev/RememberWindowPositions"
1616
},

0 commit comments

Comments
 (0)