From 6e368601b40e0c496f84f2837c80f71501afde89 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Thu, 13 Nov 2025 12:00:15 -0500 Subject: [PATCH 1/4] Wallpaper: improved image switching to avoid main thread micro freeze. --- Modules/Background/Background.qml | 41 ++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index 8c01040d..d5023fab 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -306,20 +306,37 @@ Variants { duration: transitionType == "stripes" ? Settings.data.wallpaper.transitionDuration * 1.6 : Settings.data.wallpaper.transitionDuration easing.type: Easing.InOutCubic onFinished: { - // Assign new image to current BEFORE clearing to prevent flicker + // Strategy: Keep transitionProgress at 1.0 (showing nextWallpaper) + // until currentWallpaper finishes loading asynchronously const tempSource = nextWallpaper.source - currentWallpaper.source = tempSource - transitionProgress = 0.0 + const tempSourceSize = nextWallpaper.sourceSize - // Now clear nextWallpaper after currentWallpaper has the new source - // Force complete cleanup to free texture memory (~18-25MB per monitor) - Qt.callLater(() => { - nextWallpaper.source = "" - nextWallpaper.sourceSize = undefined - Qt.callLater(() => { - currentWallpaper.asynchronous = true - }) - }) + // Enable async loading to prevent blocking + currentWallpaper.asynchronous = true + + // Create one-time connection to wait for async load to complete + const onCurrentLoaded = function () { + if (currentWallpaper.status === Image.Ready || currentWallpaper.status === Image.Error) { + // Disconnect this handler + currentWallpaper.statusChanged.disconnect(onCurrentLoaded) + + // Now it's safe to reset progress and cleanup + transitionProgress = 0.0 + + // Force complete cleanup to free texture memory (~18-25MB per monitor) + Qt.callLater(() => { + nextWallpaper.source = "" + nextWallpaper.sourceSize = undefined + }) + } + } + + // Connect the handler BEFORE changing source + currentWallpaper.statusChanged.connect(onCurrentLoaded) + + // Trigger async load (keeps nextWallpaper visible via progress=1.0) + currentWallpaper.sourceSize = tempSourceSize + currentWallpaper.source = tempSource } } From 17ff97f8c5ce8de43cf4e0c34cbd0931d1caef4e Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Thu, 13 Nov 2025 13:28:47 -0500 Subject: [PATCH 2/4] WLR Layer Name: noctalia-screen-* changed to noctalia-background-* --- Modules/MainScreen/MainScreen.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/MainScreen/MainScreen.qml b/Modules/MainScreen/MainScreen.qml index 2c15f406..3f51f134 100644 --- a/Modules/MainScreen/MainScreen.qml +++ b/Modules/MainScreen/MainScreen.qml @@ -67,7 +67,7 @@ PanelWindow { // Wayland WlrLayershell.layer: WlrLayer.Top - WlrLayershell.namespace: "noctalia-screen-" + (screen?.name || "unknown") + WlrLayershell.namespace: "noctalia-background-" + (screen?.name || "unknown") WlrLayershell.exclusionMode: ExclusionMode.Ignore // Don't reserve space - BarExclusionZone handles that WlrLayershell.keyboardFocus: WlrKeyboardFocus.None From 0ab9aa1c0e27f0703e1d0ef4cf441ad114eefcb0 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Thu, 13 Nov 2025 14:42:42 -0500 Subject: [PATCH 3/4] Tray: fix screen access that does not exists on first load. --- Modules/Bar/Extras/TrayMenu.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 05729c38..f4e17e78 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -8,13 +8,15 @@ import qs.Widgets PopupWindow { id: root + + property ShellScreen screen + property var trayItem: null property var anchorItem: null property real anchorX property real anchorY property bool isSubMenu: false property bool isHovered: rootMouseArea.containsMouse - property ShellScreen screen property string widgetSection: "" property int widgetIndex: -1 @@ -45,7 +47,7 @@ PopupWindow { implicitWidth: menuWidth // Use the content height of the Flickable for implicit height - implicitHeight: Math.min(screen.height * 0.9, flickable.contentHeight + (Style.marginS * 2)) + implicitHeight: Math.min(screen?.height * 0.9, flickable.contentHeight + (Style.marginS * 2)) visible: false color: Color.transparent anchor.item: anchorItem From 6004807776908e5e8334a8f611a588dff8f99079 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Thu, 13 Nov 2025 14:43:14 -0500 Subject: [PATCH 4/4] AllBackgrounds: centralize panel background color computation. --- .../MainScreen/Backgrounds/AllBackgrounds.qml | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Modules/MainScreen/Backgrounds/AllBackgrounds.qml b/Modules/MainScreen/Backgrounds/AllBackgrounds.qml index bd5e082e..50123f9a 100644 --- a/Modules/MainScreen/Backgrounds/AllBackgrounds.qml +++ b/Modules/MainScreen/Backgrounds/AllBackgrounds.qml @@ -23,6 +23,8 @@ Item { // Reference to MainScreen (for panel access) required property var windowRoot + readonly property color panelBackgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + anchors.fill: parent // Wrapper with layer caching for better shadow performance @@ -69,91 +71,91 @@ Item { PanelBackground { panel: root.windowRoot.audioPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Battery PanelBackground { panel: root.windowRoot.batteryPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Bluetooth PanelBackground { panel: root.windowRoot.bluetoothPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Calendar PanelBackground { panel: root.windowRoot.calendarPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Control Center PanelBackground { panel: root.windowRoot.controlCenterPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Launcher PanelBackground { panel: root.windowRoot.launcherPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Notification History PanelBackground { panel: root.windowRoot.notificationHistoryPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Session Menu PanelBackground { panel: root.windowRoot.sessionMenuPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Settings PanelBackground { panel: root.windowRoot.settingsPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Setup Wizard PanelBackground { panel: root.windowRoot.setupWizardPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // TrayDrawer PanelBackground { panel: root.windowRoot.trayDrawerPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // Wallpaper PanelBackground { panel: root.windowRoot.wallpaperPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } // WiFi PanelBackground { panel: root.windowRoot.wifiPanelPlaceholder shapeContainer: backgroundsShape - backgroundColor: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) + backgroundColor: panelBackgroundColor } }