From bf7921a17148115aabbb7ec180ceafece1a572bf Mon Sep 17 00:00:00 2001 From: reionwong Date: Sun, 5 Sep 2021 01:55:41 +0800 Subject: [PATCH] Improve smart hide --- src/activity.cpp | 10 +++++----- src/mainwindow.cpp | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/activity.cpp b/src/activity.cpp index 0aa3097..93f3571 100644 --- a/src/activity.cpp +++ b/src/activity.cpp @@ -62,11 +62,6 @@ void Activity::onActiveWindowChanged() bool launchPad = info.windowClassClass() == "cutefish-launcher"; - if (m_launchPad != launchPad) { - m_launchPad = launchPad; - emit launchPadChanged(); - } - if (DockSettings::self()->visibility() == DockSettings::IntellHide) { bool existsWindowMaximized = false; @@ -88,6 +83,11 @@ void Activity::onActiveWindowChanged() } } + if (m_launchPad != launchPad) { + m_launchPad = launchPad; + emit launchPadChanged(); + } + m_pid = info.pid(); m_windowClass = info.windowClassClass().toLower(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fca6f7a..44475f2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -352,7 +352,8 @@ void MainWindow::onVisibilityChanged() { // Always show // Must remain displayed when launchpad is opened. - if (m_settings->visibility() == DockSettings::AlwaysShow || m_activity->launchPad()) { + if (m_settings->visibility() == DockSettings::AlwaysShow + || m_activity->launchPad()) { m_hideTimer->stop(); setGeometry(windowRect()); @@ -367,6 +368,8 @@ void MainWindow::onVisibilityChanged() if (m_activity->launchPad()) return; + else + m_hideBlocked = false; if (m_settings->visibility() == DockSettings::IntellHide) { clearViewStruts();