summaryrefslogtreecommitdiff
path: root/decorations
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-08-02 13:40:25 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-08-02 13:40:25 +0200
commitb63382bb4f7c2d504255f91eacd4ee140a794ef1 (patch)
treed4f691b66340a023d4dc7ab3246961e176fd8bee /decorations
parent962890f95f74b03b1f43c816bee690e249ac524d (diff)
DecoratedWindow: initialize state chenge button with proper type
(bzr r4163.3.6)
Diffstat (limited to 'decorations')
-rw-r--r--decorations/DecoratedWindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/decorations/DecoratedWindow.cpp b/decorations/DecoratedWindow.cpp
index 21c2c68ff..164e8e0e7 100644
--- a/decorations/DecoratedWindow.cpp
+++ b/decorations/DecoratedWindow.cpp
@@ -428,7 +428,9 @@ void Window::Impl::SetupWindowControls()
if (win_->actions() & (CompWindowActionMaximizeHorzMask|CompWindowActionMaximizeVertMask))
{
- auto state_change_button = std::make_shared<WindowButton>(win_, WindowButtonType::MAXIMIZE);
+ auto type = (win_->state() & (CompWindowStateMaximizedVertMask|CompWindowStateMaximizedHorzMask)) ?
+ WindowButtonType::UNMAXIMIZE : WindowButtonType::MAXIMIZE;
+ auto state_change_button = std::make_shared<WindowButton>(win_, type);
top_layout_->Append(state_change_button);
state_change_button_ = state_change_button;
}