From edb4ab257bc80ed432d5e7e0d6d7ac38ed6f8308 Mon Sep 17 00:00:00 2001 From: Tom Strba <57389842+tomasstrba@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:44:23 +0100 Subject: [PATCH] Hiding tab preview in case the window is minimized or going full screen (#2226) Task/Issue URL: https://app.asana.com/0/1177771139624306/1206635109534553/f **Description**: This PR fixes a bug with tab preview positioning when a window is maximized. --- DuckDuckGo/MainWindow/MainViewController.swift | 8 ++++++++ DuckDuckGo/MainWindow/MainWindowController.swift | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/DuckDuckGo/MainWindow/MainViewController.swift b/DuckDuckGo/MainWindow/MainViewController.swift index adae427d70..843a190735 100644 --- a/DuckDuckGo/MainWindow/MainViewController.swift +++ b/DuckDuckGo/MainWindow/MainViewController.swift @@ -209,6 +209,14 @@ final class MainViewController: NSViewController { tabBarViewController.hideTabPreview() } + func windowWillMiniaturize() { + tabBarViewController.hideTabPreview() + } + + func windowWillEnterFullScreen() { + tabBarViewController.hideTabPreview() + } + func toggleBookmarksBarVisibility() { updateBookmarksBarViewVisibility(visible: !(mainView.bookmarksBarHeightConstraint.constant > 0)) } diff --git a/DuckDuckGo/MainWindow/MainWindowController.swift b/DuckDuckGo/MainWindow/MainWindowController.swift index d37dfab18a..06b35517fe 100644 --- a/DuckDuckGo/MainWindow/MainWindowController.swift +++ b/DuckDuckGo/MainWindow/MainWindowController.swift @@ -203,6 +203,11 @@ extension MainWindowController: NSWindowDelegate { func windowWillEnterFullScreen(_ notification: Notification) { mainViewController.tabBarViewController.draggingSpace.isHidden = true + mainViewController.windowWillEnterFullScreen() + } + + func windowWillMiniaturize(_ notification: Notification) { + mainViewController.windowWillMiniaturize() } func windowDidEnterFullScreen(_ notification: Notification) {