added adaptive quickshell

This commit is contained in:
wt committed 2026-11-17 18:15:16 +07:00
1 parent 6eb56d2065
commit 5b33a73fd8
189 files changed
+8678 -15

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
.pragma library
// Pure window ordering helpers; no compositor operations in this module.
function ordered(windows) {
return (windows || []).filter(w => w && typeof w.activate === "function");
}
function cycle(windows, currentIndex, direction) {
const list = ordered(windows);
if (!list.length) return null;
if (direction !== 1 && direction !== -1) return null;
const index = Number.isInteger(currentIndex) && currentIndex >= 0 && currentIndex < list.length ? currentIndex : (direction === 1 ? -1 : 0);
return list[(index + direction + list.length) % list.length];
}
function shouldDismissSwipe(dx, dy, width) {
return dy < -Math.max(64, Math.min(130, width * 0.2)) && Math.abs(dy) > Math.abs(dx) * 1.2;
}