CompositorService: improved Hyprland detection so there is no warning on Niri.

This commit is contained in:
LemmyCook 2025-09-12 22:55:13 -04:00
parent b66bb46fc1
commit dd4641eedd

View file

@ -15,6 +15,8 @@ Singleton {
property bool isHyprland: false
property bool isNiri: false
readonly property string hyprlandSignature: Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
// Generic workspace and window data
property ListModel workspaces: ListModel {}
property var windows: []
@ -50,6 +52,10 @@ Singleton {
}
// Hyprland connections
Loader {
active: isHyprland
sourceComponent: Component {
Item {
Connections {
target: Hyprland.workspaces
enabled: isHyprland
@ -89,11 +95,14 @@ Singleton {
}
}
}
}
}
}
function detectCompositor() {
try {
// Try Hyprland first
if (Hyprland.eventSocketPath) {
if (hyprlandSignature && hyprlandSignature.length > 0) {
compositorType = "hyprland"
isHyprland = true
isNiri = false