Skip to content

Commit 9d96947

Browse files
committed
If a window is tiled on minimize, then restore to tiling. Otherwise
restore to scratch layer.
1 parent b465859 commit 9d96947

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tiling.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,9 @@ border-radius: ${borderWidth}px;
16751675
}
16761676

16771677
destroy() {
1678+
this.getWindows().forEach(w => {
1679+
delete w.tiled_on_minimize;
1680+
});
16781681
this.signals.destroy();
16791682
this.signals = null;
16801683
this.background.destroy();
@@ -3767,10 +3770,23 @@ var focus_wrapper = Utils.dynamic_function_ref('focus_handler', this);
37673770
Push all minimized windows to the scratch layer
37683771
*/
37693772
function minimizeHandler(metaWindow) {
3770-
console.debug('minimized', metaWindow?.title);
37713773
if (metaWindow.minimized) {
3774+
console.debug('minimized', metaWindow?.title);
3775+
// check if was tiled
3776+
if (isTiled(metaWindow)) {
3777+
metaWindow.tiled_on_minimize = true;
3778+
}
37723779
Scratch.makeScratch(metaWindow);
37733780
}
3781+
else {
3782+
console.debug('unminimized', metaWindow?.title);
3783+
if (metaWindow.tiled_on_minimize) {
3784+
delete metaWindow.tiled_on_minimize;
3785+
Utils.later_add(Meta.LaterType.IDLE, () => {
3786+
Scratch.unmakeScratch(metaWindow);
3787+
});
3788+
}
3789+
}
37743790
}
37753791
var minimizeWrapper = Utils.dynamic_function_ref('minimizeHandler', this);
37763792

0 commit comments

Comments
 (0)