diff options
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/Window.cc b/src/Window.cc index d8a3f46..a6f3194 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -262,7 +262,6 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm, | |||
262 | m_last_resize_h(1), m_last_resize_w(1), | 262 | m_last_resize_h(1), m_last_resize_w(1), |
263 | m_workspace_number(0), | 263 | m_workspace_number(0), |
264 | m_current_state(0), | 264 | m_current_state(0), |
265 | m_old_decoration(DECOR_NORMAL), | ||
266 | m_old_decoration_mask(0), | 265 | m_old_decoration_mask(0), |
267 | m_client(&client), | 266 | m_client(&client), |
268 | m_toggled_decos(false), | 267 | m_toggled_decos(false), |
@@ -1243,8 +1242,7 @@ void FluxboxWindow::updateBlackboxHintsFromClient(const WinClient &client) { | |||
1243 | m_workspace_number = hint->stack; | 1242 | m_workspace_number = hint->stack; |
1244 | 1243 | ||
1245 | if (hint->flags & ATTRIB_DECORATION) { | 1244 | if (hint->flags & ATTRIB_DECORATION) { |
1246 | m_old_decoration = static_cast<Decoration>(hint->decoration); | 1245 | setDecoration(static_cast<Decoration>(hint->decoration), false); |
1247 | setDecoration(m_old_decoration, false); | ||
1248 | } | 1246 | } |
1249 | } | 1247 | } |
1250 | 1248 | ||
@@ -1577,8 +1575,10 @@ void FluxboxWindow::setFullscreen(bool flag) { | |||
1577 | 1575 | ||
1578 | frame().setUseShape(false); | 1576 | frame().setUseShape(false); |
1579 | 1577 | ||
1580 | m_old_decoration_mask = decorationMask(); | 1578 | if (!m_toggled_decos) |
1581 | m_old_layernum =layerNum(); | 1579 | m_old_decoration_mask = decorationMask(); |
1580 | |||
1581 | m_old_layernum = layerNum(); | ||
1582 | m_old_pos_x = frame().x(); | 1582 | m_old_pos_x = frame().x(); |
1583 | m_old_pos_y = frame().y(); | 1583 | m_old_pos_y = frame().y(); |
1584 | m_old_width = frame().width(); | 1584 | m_old_width = frame().width(); |
@@ -1609,8 +1609,14 @@ void FluxboxWindow::setFullscreen(bool flag) { | |||
1609 | 1609 | ||
1610 | fullscreen = false; | 1610 | fullscreen = false; |
1611 | 1611 | ||
1612 | setDecorationMask(m_old_decoration_mask); | ||
1613 | frame().setUseShape(!m_shaped); | 1612 | frame().setUseShape(!m_shaped); |
1613 | if (m_toggled_decos) { | ||
1614 | if (m_old_decoration_mask & DECORM_TITLEBAR) | ||
1615 | setDecoration(DECOR_NONE); | ||
1616 | else | ||
1617 | setDecoration(DECOR_NORMAL); | ||
1618 | } else | ||
1619 | setDecorationMask(m_old_decoration_mask); | ||
1614 | 1620 | ||
1615 | // ensure we apply the sizehints here, otherwise some | 1621 | // ensure we apply the sizehints here, otherwise some |
1616 | // apps (eg xterm) end up a little bit .. crappy (visually) | 1622 | // apps (eg xterm) end up a little bit .. crappy (visually) |
@@ -1624,7 +1630,6 @@ void FluxboxWindow::setFullscreen(bool flag) { | |||
1624 | moveResize(m_last_resize_x, m_last_resize_y, m_last_resize_w, m_last_resize_h); | 1630 | moveResize(m_last_resize_x, m_last_resize_y, m_last_resize_w, m_last_resize_h); |
1625 | moveToLayer(m_old_layernum); | 1631 | moveToLayer(m_old_layernum); |
1626 | 1632 | ||
1627 | m_old_decoration_mask = 0; | ||
1628 | m_old_layernum = ::Layer::NORMAL; | 1633 | m_old_layernum = ::Layer::NORMAL; |
1629 | 1634 | ||
1630 | stateSig().notify(); | 1635 | stateSig().notify(); |
@@ -3205,22 +3210,20 @@ void FluxboxWindow::applyDecorations(bool initial) { | |||
3205 | 3210 | ||
3206 | void FluxboxWindow::toggleDecoration() { | 3211 | void FluxboxWindow::toggleDecoration() { |
3207 | //don't toggle decor if the window is shaded | 3212 | //don't toggle decor if the window is shaded |
3208 | if (isShaded()) | 3213 | if (isShaded() || isFullscreen()) |
3209 | return; | 3214 | return; |
3210 | 3215 | ||
3211 | m_toggled_decos= true; | 3216 | m_toggled_decos = !m_toggled_decos; |
3212 | 3217 | ||
3213 | if (decorations.enabled) { //remove decorations | 3218 | if (m_toggled_decos) { |
3214 | decorations.enabled = false; | 3219 | m_old_decoration_mask = decorationMask(); |
3215 | setDecoration(DECOR_NONE); | 3220 | if (decorations.titlebar) |
3216 | } else { //revert back to old decoration | 3221 | setDecoration(DECOR_NONE); |
3217 | decorations.enabled = true; | 3222 | else |
3218 | if (m_old_decoration == DECOR_NONE) { // make sure something happens | ||
3219 | setDecoration(DECOR_NORMAL); | 3223 | setDecoration(DECOR_NORMAL); |
3220 | } else { | 3224 | } else |
3221 | setDecoration(m_old_decoration); | 3225 | setDecorationMask(m_old_decoration_mask); |
3222 | } | 3226 | |
3223 | } | ||
3224 | } | 3227 | } |
3225 | 3228 | ||
3226 | unsigned int FluxboxWindow::decorationMask() const { | 3229 | unsigned int FluxboxWindow::decorationMask() const { |
@@ -3866,8 +3869,7 @@ void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) { | |||
3866 | } | 3869 | } |
3867 | 3870 | ||
3868 | if (net.flags & ATTRIB_DECORATION) { | 3871 | if (net.flags & ATTRIB_DECORATION) { |
3869 | m_old_decoration = static_cast<Decoration>(net.decoration); | 3872 | setDecoration(static_cast<Decoration>(net.decoration)); |
3870 | setDecoration(m_old_decoration); | ||
3871 | } | 3873 | } |
3872 | 3874 | ||
3873 | } | 3875 | } |