From c2ccccd093ab0cba43fdf9ec874f16e8ef2efbd0 Mon Sep 17 00:00:00 2001 From: lwouis Date: Sat, 4 Jan 2025 01:08:36 +0100 Subject: [PATCH] fix: app badges could be incorrectly positioned on the very first launch --- src/ui/main-window/ThumbnailView.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ui/main-window/ThumbnailView.swift b/src/ui/main-window/ThumbnailView.swift index 3c89755f..76e47681 100644 --- a/src/ui/main-window/ThumbnailView.swift +++ b/src/ui/main-window/ThumbnailView.swift @@ -446,12 +446,12 @@ class ThumbnailView: FlippedView { } windowlessAppIndicator.frame.origin.y = windowlessAppIndicator.superview!.frame.height - windowlessAppIndicator.frame.height } - if !dockLabelIcon.isHidden { - let iconSize = ThumbnailView.iconSize() - dockLabelIcon.frame.origin.x = ((iconSize.width * 0.8) - (dockLabelIcon.fittingSize.width / 2)).rounded() - dockLabelIcon.frame.origin.y = ((iconSize.height * 0.8) - (dockLabelIcon.fittingSize.height / 2)).rounded() - - (Preferences.appearanceSize == .small ? 2 : 0) - } + // we set dockLabelIcon origin, without checking if .isHidden + // This is because its updated async. We needed it positioned correctly always + let iconSize = ThumbnailView.iconSize() + dockLabelIcon.frame.origin.x = ((iconSize.width * 0.8) - (dockLabelIcon.fittingSize.width / 2)).rounded() + dockLabelIcon.frame.origin.y = ((iconSize.height * 0.8) - (dockLabelIcon.fittingSize.height / 2)).rounded() + - (Preferences.appearanceSize == .small ? 2 : 0) } private func indicatorsSpace() -> CGFloat {