mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Compositor: Reworked the compositor detection to make it more robust when switching from one to another in TTY
- Sway seems to leave its SWAYSOCK valid when going back to TTY, which would break Noctalia on Niri. Was probably fine with a display manager. + Autofmt
This commit is contained in:
@@ -297,8 +297,7 @@ NPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Spacer
|
// Spacer
|
||||||
Item {
|
Item {}
|
||||||
}
|
|
||||||
|
|
||||||
// Navigation and divider
|
// Navigation and divider
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -32,8 +32,14 @@ Singleton {
|
|||||||
|
|
||||||
function detectCompositor() {
|
function detectCompositor() {
|
||||||
const hyprlandSignature = Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
|
const hyprlandSignature = Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
|
||||||
|
const niriSocket = Quickshell.env("NIRI_SOCKET")
|
||||||
const swaySock = Quickshell.env("SWAYSOCK")
|
const swaySock = Quickshell.env("SWAYSOCK")
|
||||||
if (hyprlandSignature && hyprlandSignature.length > 0) {
|
if (niriSocket && niriSocket.length > 0) {
|
||||||
|
isHyprland = false
|
||||||
|
isNiri = true
|
||||||
|
isSway = false
|
||||||
|
backendLoader.sourceComponent = niriComponent
|
||||||
|
} else if (hyprlandSignature && hyprlandSignature.length > 0) {
|
||||||
isHyprland = true
|
isHyprland = true
|
||||||
isNiri = false
|
isNiri = false
|
||||||
isSway = false
|
isSway = false
|
||||||
@@ -44,7 +50,7 @@ Singleton {
|
|||||||
isSway = true
|
isSway = true
|
||||||
backendLoader.sourceComponent = swayComponent
|
backendLoader.sourceComponent = swayComponent
|
||||||
} else {
|
} else {
|
||||||
// Default to Niri
|
// Always fallback to Niri
|
||||||
isHyprland = false
|
isHyprland = false
|
||||||
isNiri = true
|
isNiri = true
|
||||||
isSway = false
|
isSway = false
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ Item {
|
|||||||
if (!toplevel)
|
if (!toplevel)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
return toplevel.appId;
|
return toplevel.appId
|
||||||
}
|
}
|
||||||
|
|
||||||
// Safe property getter
|
// Safe property getter
|
||||||
|
|||||||
Reference in New Issue
Block a user