This commit is contained in:
Ly-sec
2025-11-13 21:01:15 +01:00
4 changed files with 49 additions and 28 deletions
+29 -12
View File
@@ -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
}
}
+4 -2
View File
@@ -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
@@ -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
}
}
+1 -1
View File
@@ -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