mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Shell: Improved init sequence, IPC: null safety for panels toggle.
This commit is contained in:
@@ -99,69 +99,70 @@ ShellRoot {
|
||||
}
|
||||
}
|
||||
|
||||
// IPCService is treated as a service
|
||||
// but it's actually an Item that needs to exists in the shell.
|
||||
// IPCService is treated as a service but it's actually an
|
||||
// Item that needs to exists in the shell.
|
||||
IPCService {}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------
|
||||
// MainScreen for each screen (manages bar + all panels)
|
||||
// Wrapped in Loader to optimize memory - only loads when screen needs it
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
delegate: Item {
|
||||
required property ShellScreen modelData
|
||||
// ------------------------------
|
||||
// MainScreen for each screen (manages bar + all panels)
|
||||
// Wrapped in Loader to optimize memory - only loads when screen needs it
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
delegate: Item {
|
||||
required property ShellScreen modelData
|
||||
|
||||
property bool shouldBeActive: {
|
||||
if (!i18nLoaded || !settingsLoaded || !modelData || !modelData.name)
|
||||
Logger.d("Shell", "MainScreen activated for", modelData?.name)
|
||||
return true
|
||||
}
|
||||
property bool shouldBeActive: {
|
||||
if (!modelData || !modelData.name)
|
||||
Logger.d("Shell", "MainScreen activated for", modelData?.name)
|
||||
return true
|
||||
}
|
||||
|
||||
property bool windowLoaded: false
|
||||
property bool windowLoaded: false
|
||||
|
||||
Loader {
|
||||
id: windowLoader
|
||||
active: parent.shouldBeActive
|
||||
asynchronous: false
|
||||
Loader {
|
||||
id: windowLoader
|
||||
active: parent.shouldBeActive
|
||||
asynchronous: false
|
||||
|
||||
property ShellScreen loaderScreen: modelData
|
||||
property ShellScreen loaderScreen: modelData
|
||||
|
||||
onLoaded: {
|
||||
// Signal that window is loaded so exclusion zone can be created
|
||||
parent.windowLoaded = true
|
||||
}
|
||||
onLoaded: {
|
||||
// Signal that window is loaded so exclusion zone can be created
|
||||
parent.windowLoaded = true
|
||||
}
|
||||
|
||||
sourceComponent: MainScreen {
|
||||
screen: windowLoader.loaderScreen
|
||||
}
|
||||
}
|
||||
sourceComponent: MainScreen {
|
||||
screen: windowLoader.loaderScreen
|
||||
}
|
||||
}
|
||||
|
||||
// BarExclusionZone - created after MainScreen has fully loaded
|
||||
// Disabled when bar is hidden or not configured for this screen
|
||||
Loader {
|
||||
active: {
|
||||
if (!parent.windowLoaded || !parent.shouldBeActive || !BarService.isVisible)
|
||||
return false
|
||||
// BarExclusionZone - created after MainScreen has fully loaded
|
||||
// Disabled when bar is hidden or not configured for this screen
|
||||
Loader {
|
||||
active: {
|
||||
if (!parent.windowLoaded || !parent.shouldBeActive || !BarService.isVisible)
|
||||
return false
|
||||
|
||||
// Check if bar is configured for this screen
|
||||
var monitors = Settings.data.bar.monitors || []
|
||||
return monitors.length === 0 || monitors.includes(modelData?.name)
|
||||
}
|
||||
asynchronous: false
|
||||
// Check if bar is configured for this screen
|
||||
var monitors = Settings.data.bar.monitors || []
|
||||
return monitors.length === 0 || monitors.includes(modelData?.name)
|
||||
}
|
||||
asynchronous: false
|
||||
|
||||
sourceComponent: BarExclusionZone {
|
||||
screen: modelData
|
||||
}
|
||||
sourceComponent: BarExclusionZone {
|
||||
screen: modelData
|
||||
}
|
||||
|
||||
onLoaded: {
|
||||
Logger.d("Shell", "BarExclusionZone created for", modelData?.name)
|
||||
onLoaded: {
|
||||
Logger.d("Shell", "BarExclusionZone created for", modelData?.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup Wizard - Auto Kick start
|
||||
Connections {
|
||||
target: Settings
|
||||
function onSettingsLoaded() {
|
||||
|
||||
Reference in New Issue
Block a user