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:
@@ -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
|
||||
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user