From 185395caabef20f406509116015847dc6c8e5bd4 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 3 Feb 2022 10:43:36 +0200 Subject: [PATCH] wayland: Simplify xdg-shell's maximize mode implementation XdgToplevelClient::changeMaximize() will unset quick tile mode after maximizing the window. --- src/xdgshellclient.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index 859bee62f7..07abe277bb 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -1670,21 +1670,6 @@ void XdgToplevelClient::changeMaximize(bool horizontal, bool vertical, bool adju setGeometryRestore(savedGeometry); } - // Conditional quick tiling exit points - const auto oldQuickTileMode = quickTileMode(); - if (quickTileMode() != QuickTileMode(QuickTileFlag::None)) { - if (oldMode == MaximizeFull && - !clientArea.contains(geometryRestore().center())) { - // Not restoring on the same screen - // TODO: The following doesn't work for some reason - //quick_tile_mode = QuickTileNone; // And exit quick tile mode manually - } else if ((oldMode == MaximizeVertical && m_requestedMaximizeMode == MaximizeRestore) || - (oldMode == MaximizeFull && m_requestedMaximizeMode == MaximizeHorizontal)) { - // Modifying geometry of a tiled window - updateQuickTileMode(QuickTileFlag::None); // Exit quick tile mode without restoring geometry - } - } - const MaximizeMode delta = m_requestedMaximizeMode ^ oldMode; QRect geometry = oldGeometry; @@ -1724,13 +1709,14 @@ void XdgToplevelClient::changeMaximize(bool horizontal, bool vertical, bool adju } } + const auto oldQuickTileMode = quickTileMode(); if (m_requestedMaximizeMode == MaximizeFull) { if (options->electricBorderMaximize()) { updateQuickTileMode(QuickTileFlag::Maximize); } else { updateQuickTileMode(QuickTileFlag::None); } - } else if (m_requestedMaximizeMode == MaximizeRestore) { + } else { updateQuickTileMode(QuickTileFlag::None); }