From 5ef71c92ce6be7fed8a5ffc7bbe50bde7fd9a64a Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Fri, 22 Sep 2023 11:15:35 +0200 Subject: [PATCH] Column: prevent stacking columns with unshadeable windows --- src/extern/kwin.d.ts | 1 + src/layout/Column.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/extern/kwin.d.ts b/src/extern/kwin.d.ts index 26f096c..76df038 100644 --- a/src/extern/kwin.d.ts +++ b/src/extern/kwin.d.ts @@ -34,6 +34,7 @@ type Tile = any; interface KwinClient { // Read-only Properties + readonly shadeable: boolean; readonly caption: string; readonly minSize: QSize; readonly transient: boolean; diff --git a/src/layout/Column.ts b/src/layout/Column.ts index 379cf1b..c0dca74 100644 --- a/src/layout/Column.ts +++ b/src/layout/Column.ts @@ -181,7 +181,7 @@ class Column { } public arrange(x: number) { - if (this.stacked && this.windows.length() >= 2) { + if (this.stacked && this.windows.length() >= 2 && this.canStack()) { this.arrangeStacked(x); return; } @@ -228,6 +228,15 @@ class Column { this.grid.desktop.onLayoutChanged(); } + private canStack() { + for (const window of this.windows.iterator()) { + if (!window.client.kwinClient.shadeable) { + return false; + } + } + return true; + } + public isVisible(scrollPos: Desktop.ScrollPos, fullyVisible: boolean) { if (fullyVisible) { return this.getLeft() >= scrollPos.getLeft() &&