From b2ff46549075343710bc0e106b9e80085eae7823 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 6 Jun 2024 18:49:17 +0200 Subject: [PATCH] workspace,window: don't elevate windows during electric border tiling / maximizing Instead, move the outline below the window, so that the visual order of things stays the same. This also fixes a visual glitch, where the outline is visible for a moment after maximization, and is above the no-longer-elevated window BUG: 436466 BUG: 354741 --- src/window.cpp | 5 +++-- src/workspace.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 7335da8b6b..a513011137 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -564,6 +564,9 @@ void Window::updateLayer() Layer Window::belongsToLayer() const { + if (isOutline()) { + return NormalLayer; + } if (isUnmanaged() || isInternal()) { return OverlayLayer; } @@ -2415,7 +2418,6 @@ void Window::leaveInteractiveMoveResize() } if (isElectricBorderMaximizing()) { workspace()->outline()->hide(); - elevate(false); } } @@ -3382,7 +3384,6 @@ void Window::setElectricBorderMaximizing(bool maximizing) } else { workspace()->outline()->hide(); } - elevate(maximizing); } QRectF Window::quickTileGeometry(QuickTileMode mode, const QPointF &pos) const diff --git a/src/workspace.cpp b/src/workspace.cpp index abdb3b57db..8dd5ec8c90 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -751,6 +751,9 @@ void Workspace::addUnmanaged(X11Window *window) m_windows.append(window); addToStack(window); updateStackingOrder(true); + if (window->isOutline() && m_moveResizeWindow) { + constrain(window, m_moveResizeWindow); + } Q_EMIT windowAdded(window); } @@ -2077,6 +2080,9 @@ void Workspace::addInternalWindow(InternalWindow *window) } updateStackingOrder(true); + if (window->isOutline() && moveResizeWindow()) { + constrain(window, moveResizeWindow()); + } Q_EMIT windowAdded(window); }