1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

modals: single window optimization

This commit is contained in:
bbedward
2025-12-01 17:49:32 -05:00
parent 139c99001a
commit 468e569bc7
19 changed files with 660 additions and 639 deletions

View File

@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.I3
import Quickshell.Wayland
import Quickshell.Hyprland
import qs.Common
@@ -23,6 +24,31 @@ Singleton {
readonly property string labwcPid: Quickshell.env("LABWC_PID")
property bool useNiriSorting: isNiri && NiriService
readonly property string focusedScreenName: {
if (isHyprland && Hyprland.focusedMonitor)
return Hyprland.focusedMonitor.name;
if (isNiri && NiriService.currentOutput)
return NiriService.currentOutput;
if (isDwl && DwlService.activeOutput)
return DwlService.activeOutput;
if (isSway) {
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
if (focusedWs?.monitor?.name)
return focusedWs.monitor.name;
}
return Quickshell.screens[0]?.name ?? "";
}
readonly property var focusedScreen: {
if (!focusedScreenName)
return Quickshell.screens[0] ?? null;
for (const s of Quickshell.screens) {
if (s.name === focusedScreenName)
return s;
}
return Quickshell.screens[0] ?? null;
}
property var sortedToplevels: []
property bool _sortScheduled: false

View File

@@ -666,11 +666,7 @@ Singleton {
return;
}
if (SessionData.nightModeAutoEnabled) {
startAutomation();
} else {
applyNightModeDirectly();
}
evaluateNightMode();
});
}
}
@@ -680,7 +676,7 @@ Singleton {
Timer {
id: restartTimer
property string nextAction: ""
interval: 100
interval: 250
repeat: false
onTriggered: {