fix(mainscreen): avoid potential single frame flicker of the bar when resizing

This commit is contained in:
Lemmy
2026-03-19 23:53:22 -04:00
parent 67a7f75c37
commit 219a4742df
+7 -2
View File
@@ -92,6 +92,11 @@ PanelWindow {
property bool _needsFullscreen: isAnyPanelOpen || PanelService.closingPanel !== null || _dimmerAnimating
property bool _dimmerAnimating: false
// Whether the window is actually collapsed (bar-sized) right now.
// Uses actual window dimensions so barPlaceholder coordinates switch in sync
// with the compositor resize, avoiding a 1-frame bar background flash.
readonly property bool _isCollapsed: !isFramed && (root.width < (screen?.width ?? 1) || root.height < (screen?.height ?? 1))
// Shadow padding for collapsed window — shadow extends beyond bar into the screen
readonly property real _shadowPadding: (Settings.data.general.enableShadows && !PowerProfileService.noctaliaPerformanceMode) ? Style.shadowBlurMax + Math.max(Math.abs(Style.shadowHorizontalOffset), Math.abs(Style.shadowVerticalOffset)) : 0
// Inner padding: the side facing into the screen needs at least shadow clearance
@@ -480,7 +485,7 @@ PanelWindow {
// Expose bar dimensions directly on this Item for BarBackground
// Use screen dimensions directly
x: {
if (!root._needsFullscreen && !root.isFramed) {
if (root._isCollapsed) {
// Collapsed: bar is at margin from screen edge, shadow extends inward.
// For right bar the window faces left (inner side first), so bar starts after shadow clearance.
return barPosition === "right" ? root._innerPaddingH : barMarginH;
@@ -492,7 +497,7 @@ PanelWindow {
return barMarginH;
}
y: {
if (!root._needsFullscreen && !root.isFramed) {
if (root._isCollapsed) {
return barPosition === "bottom" ? root._innerPaddingV : barMarginV;
}
if (barPosition === "bottom")