diff --git a/geometry.cpp b/geometry.cpp index c63342723f..a79388d165 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1863,13 +1863,8 @@ bool Client::isResizable() const */ bool Client::isMaximizable() const { - { - // isMovable() and isResizable() may be false for maximized windows - // with moving/resizing maximized windows disabled - TemporaryAssign< MaximizeMode > tmp(max_mode, MaximizeRestore); - if (!isResizable() || isToolbar()) // SELI isToolbar() ? - return false; - } + if (!isResizable() || isToolbar()) // SELI isToolbar() ? + return false; if (rules()->checkMaximize(MaximizeRestore) == MaximizeRestore && rules()->checkMaximize(MaximizeFull) != MaximizeRestore) return true; return false; @@ -2161,14 +2156,8 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) if (changeMaximizeRecursion) return; - // sic! codeblock for TemporaryAssign - { - // isMovable() and isResizable() may be false for maximized windows - // with moving/resizing maximized windows disabled - TemporaryAssign< MaximizeMode > tmp(max_mode, MaximizeRestore); - if (!isResizable() || isToolbar()) // SELI isToolbar() ? - return; - } + if (!isResizable() || isToolbar()) // SELI isToolbar() ? + return; QRect clientArea; if (isElectricBorderMaximizing()) diff --git a/utils.h b/utils.h index 40e969c38c..2376d08769 100644 --- a/utils.h +++ b/utils.h @@ -127,26 +127,6 @@ enum ShadeMode { ShadeActivated // "shaded", but visible due to alt+tab to the window }; -// Class which saves original value of the variable, assigns the new value -// to it, and in the destructor restores the value. -// Used in Client::isMaximizable() and so on. -// It also casts away contness and generally this looks like a hack. -template< typename T > -class TemporaryAssign -{ -public: - TemporaryAssign(const T& var, const T& value) - : variable(var), orig(var) { - const_cast< T& >(variable) = value; - } - ~TemporaryAssign() { - const_cast< T& >(variable) = orig; - } -private: - const T& variable; - T orig; -}; - template class ScopedCPointer : public QScopedPointer {