From f0c473507a69686383c197f64c9dd88537b24366 Mon Sep 17 00:00:00 2001 From: reionwong Date: Sun, 5 Sep 2021 02:40:27 +0800 Subject: [PATCH] Improve hide --- src/activity.cpp | 6 +++--- src/mainwindow.cpp | 7 ++++--- src/xwindowinterface.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/activity.cpp b/src/activity.cpp index 93f3571..b7e3a13 100644 --- a/src/activity.cpp +++ b/src/activity.cpp @@ -53,7 +53,7 @@ bool Activity::launchPad() const { return m_launchPad; } - +#include void Activity::onActiveWindowChanged() { KWindowInfo info(KWindowSystem::activeWindow(), @@ -66,9 +66,9 @@ void Activity::onActiveWindowChanged() bool existsWindowMaximized = false; for (WId wid : KWindowSystem::windows()) { - KWindowInfo i(wid, NET::WMState); + KWindowInfo i(wid, NET::WMState, NET::WM2WindowClass); - if (i.isMinimized()) + if (i.isMinimized() || i.hasState(NET::SkipTaskbar)) continue; if (i.hasState(NET::MaxVert) || i.hasState(NET::MaxHoriz)) { diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 44475f2..9330484 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -368,13 +368,14 @@ void MainWindow::onVisibilityChanged() if (m_activity->launchPad()) return; - else - m_hideBlocked = false; if (m_settings->visibility() == DockSettings::IntellHide) { clearViewStruts(); setGeometry(windowRect()); + if (!m_fakeWindow && !m_activity->existsWindowMaximized()) + m_hideBlocked = false; + if (m_activity->existsWindowMaximized() && !m_hideBlocked) { setVisible(false); } else { @@ -389,7 +390,7 @@ void MainWindow::onVisibilityChanged() if (m_settings->visibility() == DockSettings::AlwaysHide) { clearViewStruts(); setGeometry(windowRect()); - setVisible(false); + setVisible(m_hideBlocked); // Create if (!m_fakeWindow) diff --git a/src/xwindowinterface.cpp b/src/xwindowinterface.cpp index ea5327a..1c673fc 100644 --- a/src/xwindowinterface.cpp +++ b/src/xwindowinterface.cpp @@ -149,7 +149,7 @@ void XWindowInterface::setViewStruts(QWindow *view, DockSettings::Direction dire const auto screen = view->screen(); - const QRect currentScreen {screen->geometry()}; + // const QRect currentScreen {screen->geometry()}; const QRect wholeScreen { {0, 0}, screen->virtualSize() }; const int edgeMargins = compositing ? DockSettings::self()->edgeMargins() : 0;