From a1f8b188888f0f33fc2dd353b8b5d84c0bd83483 Mon Sep 17 00:00:00 2001 From: lwouis Date: Sat, 21 Mar 2026 18:27:49 +0100 Subject: [PATCH] fix: panel may re-center when searching --- src/ui/main-window/TilesPanel.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ui/main-window/TilesPanel.swift b/src/ui/main-window/TilesPanel.swift index 6a3dcf26..de9a7065 100644 --- a/src/ui/main-window/TilesPanel.swift +++ b/src/ui/main-window/TilesPanel.swift @@ -6,7 +6,6 @@ class TilesPanel: NSPanel { static var maxPossibleAppIconSize = NSSize.zero static var shared: TilesPanel! private var frozenTopCenter: NSPoint? - private var highWaterWidth: CGFloat = 0 private var highWaterHeight: CGFloat = 0 convenience init() { @@ -56,21 +55,17 @@ class TilesPanel: NSPanel { resetFrozenPosition() return } - if size.width > highWaterWidth || size.height > highWaterHeight { + if size.height > highWaterHeight { NSScreen.preferred.repositionPanel(self) - highWaterWidth = size.width highWaterHeight = size.height frozenTopCenter = NSPoint(x: frame.midX, y: frame.maxY) } else if let topCenter = frozenTopCenter { - let x = topCenter.x - size.width * 0.5 - let y = topCenter.y - size.height - setFrameOrigin(NSPoint(x: x, y: y)) + setFrameOrigin(NSPoint(x: topCenter.x - size.width * 0.5, y: topCenter.y - size.height)) } } func resetFrozenPosition() { frozenTopCenter = nil - highWaterWidth = 0 highWaterHeight = 0 }