// SimpleDwindle
// KWin 6.8 - Minimal chronological Dwindle
-const VERSION = "0.7.0";
+const VERSION = "0.7.1";
// ------------------------------------------------------------
// Configuration
const interactiveMoves = new Map();
const multiDesktop = [];
const quarantinedLayouts = new Set();
+const dirtyLayouts = new Set();
const SYNC_DELAY_MS = 50;
let syncSerial = 0;
let pendingSync = null;
}
}
+// An inactive desktop's geometry is applied when it becomes visible.
+function arrangeOrDefer(layout) {
+ if (!layout) return;
+ if (layout.desktop !== workspace.currentDesktop) {
+ dirtyLayouts.add(layout);
+ return;
+ }
+ arrange(layout);
+ dirtyLayouts.delete(layout);
+}
+
function arrange(layout, skipWindow = null) {
if (!layout || quarantinedLayouts.has(layout) || !layout.root)
return;
if (oldLayout) {
removeNode(oldLayout, w);
normalizeSplits(oldLayout.root);
- arrange(oldLayout);
+ arrangeOrDefer(oldLayout);
}
const target = layoutFor(w);
insertWindow(target, w);
normalizeSplits(target.root);
- arrange(target);
- log("MOVED/TILED: " + w.caption);
+ arrangeOrDefer(target);
+ log("MOVED/TILED: " + w.caption +
+ " targetDirty=" + dirtyLayouts.has(target));
return 1;
}
workspace.windowAdded.connect(handleWindowAdded);
workspace.windowRemoved.connect(handleWindowRemoved);
+// KWin does not activate the destination desktop when moving a window.
+// Reapply the destination tree once its desktop actually becomes active.
+workspace.currentDesktopChanged.connect(function() {
+ let applied = 0;
+ for (const layout of layouts) {
+ if (layout.desktop !== workspace.currentDesktop) continue;
+ if (!layout.root || quarantinedLayouts.has(layout)) continue;
+ arrange(layout);
+ dirtyLayouts.delete(layout);
+ applied++;
+ }
+ log("DESKTOP ACTIVATED: arranged=" + applied);
+});
+
workspace.screensChanged.connect(function() {
for (const layout of layouts)
arrange(layout);