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
|
||||
Item {
|
||||
}
|
||||
Item {}
|
||||
|
||||
// Navigation and divider
|
||||
RowLayout {
|
||||
|
||||
@@ -32,8 +32,14 @@ Singleton {
|
||||
|
||||
function detectCompositor() {
|
||||
const hyprlandSignature = Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
|
||||
const niriSocket = Quickshell.env("NIRI_SOCKET")
|
||||
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
|
||||
isNiri = false
|
||||
isSway = false
|
||||
@@ -44,7 +50,7 @@ Singleton {
|
||||
isSway = true
|
||||
backendLoader.sourceComponent = swayComponent
|
||||
} else {
|
||||
// Default to Niri
|
||||
// Always fallback to Niri
|
||||
isHyprland = false
|
||||
isNiri = true
|
||||
isSway = false
|
||||
|
||||
@@ -155,7 +155,7 @@ Item {
|
||||
if (!toplevel)
|
||||
return ""
|
||||
|
||||
return toplevel.appId;
|
||||
return toplevel.appId
|
||||
}
|
||||
|
||||
// Safe property getter
|
||||
|
||||
Reference in New Issue
Block a user