diff --git a/src/window.cpp b/src/window.cpp index 38b63c50fa..44e5bd3ed3 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1580,9 +1580,10 @@ void Window::blockGeometryUpdates(bool block) } } -void Window::maximize(MaximizeMode m) +void Window::maximize(MaximizeMode mode) { - changeMaximize(m); + Q_UNUSED(mode) + qCWarning(KWIN_CORE, "%s doesn't support setting maximized state", metaObject()->className()); } void Window::setMaximize(bool vertically, bool horizontally) @@ -4332,12 +4333,6 @@ void Window::setGeometryRestore(const QRectF &rect) m_maximizeGeometryRestore = rect; } -void Window::changeMaximize(MaximizeMode mode) -{ - Q_UNUSED(mode) - qCWarning(KWIN_CORE, "%s doesn't support setting maximized state", metaObject()->className()); -} - void Window::invalidateDecoration() { } diff --git a/src/window.h b/src/window.h index dd0c76753a..3f1cf110fa 100644 --- a/src/window.h +++ b/src/window.h @@ -1028,7 +1028,7 @@ public: QRectF geometryRestore() const; virtual MaximizeMode maximizeMode() const; virtual MaximizeMode requestedMaximizeMode() const; - void maximize(MaximizeMode); + virtual void maximize(MaximizeMode mode); /** * Sets the maximization according to @p vertically and @p horizontally. */ @@ -1721,7 +1721,6 @@ protected: int borderRight() const; int borderTop() const; int borderBottom() const; - virtual void changeMaximize(MaximizeMode mode); void setGeometryRestore(const QRectF &rect); void blockGeometryUpdates(bool block); diff --git a/src/x11window.cpp b/src/x11window.cpp index 2381e7908d..e9675d1831 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -4265,7 +4265,7 @@ void X11Window::updateServerGeometry() } static bool changeMaximizeRecursion = false; -void X11Window::changeMaximize(MaximizeMode mode) +void X11Window::maximize(MaximizeMode mode) { if (changeMaximizeRecursion) { return; @@ -4320,7 +4320,7 @@ void X11Window::changeMaximize(MaximizeMode mode) // so restore first and then maximize the other way if ((old_mode == MaximizeVertical && mode == MaximizeHorizontal) || (old_mode == MaximizeHorizontal && mode == MaximizeVertical)) { - changeMaximize(MaximizeRestore); // restore + maximize(MaximizeRestore); // restore } Q_EMIT clientMaximizedStateAboutToChange(this, mode); diff --git a/src/x11window.h b/src/x11window.h index 8dc82cd92b..59e1f16a1f 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -158,6 +158,7 @@ public: bool isShadeable() const override; bool isMaximizable() const override; MaximizeMode maximizeMode() const override; + void maximize(MaximizeMode mode) override; bool isMinimizable() const override; QRectF iconGeometry() const override; @@ -392,7 +393,6 @@ private: bool isManaged() const; ///< Returns false if this client is not yet managed void updateAllowedActions(bool force = false); QRect fullscreenMonitorsArea(NETFullscreenMonitors topology) const; - void changeMaximize(MaximizeMode mode) override; void getWmNormalHints(); void getMotifHints(); void getIcons(); diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 75b15a28d1..3535c6952c 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -1638,11 +1638,8 @@ void XdgToplevelWindow::setFullScreen(bool set, bool user) doSetFullScreen(); } -/** - * \todo Move to Window. - */ static bool changeMaximizeRecursion = false; -void XdgToplevelWindow::changeMaximize(MaximizeMode mode) +void XdgToplevelWindow::maximize(MaximizeMode mode) { if (changeMaximizeRecursion) { return; diff --git a/src/xdgshellwindow.h b/src/xdgshellwindow.h index a4bfdef027..6f1d1aa460 100644 --- a/src/xdgshellwindow.h +++ b/src/xdgshellwindow.h @@ -162,6 +162,7 @@ public: void showOnScreenEdge() override; void setFullScreen(bool set, bool user) override; void closeWindow() override; + void maximize(MaximizeMode mode) override; void installAppMenu(KWaylandServer::AppMenuInterface *appMenu); void installServerDecoration(KWaylandServer::ServerSideDecorationInterface *decoration); @@ -180,7 +181,6 @@ protected: bool doStartInteractiveMoveResize() override; void doFinishInteractiveMoveResize() override; bool acceptsFocus() const override; - void changeMaximize(MaximizeMode mode) override; Layer layerForDock() const override; void doSetQuickTileMode() override;