diff options
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index becbe36..b9f3302 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -489,6 +489,14 @@ void FbWinFrame::setFocus(bool newvalue) { | |||
489 | clearAll(); | 489 | clearAll(); |
490 | } | 490 | } |
491 | 491 | ||
492 | void FbWinFrame::setFullscreen(bool newvalue) { | ||
493 | if (newvalue == m_state.fullscreen) | ||
494 | return; | ||
495 | |||
496 | m_state.fullscreen = newvalue; | ||
497 | applyDecorations(); | ||
498 | } | ||
499 | |||
492 | void FbWinFrame::setAlpha(bool focused, unsigned char alpha) { | 500 | void FbWinFrame::setAlpha(bool focused, unsigned char alpha) { |
493 | if (focused) | 501 | if (focused) |
494 | m_focused_alpha = alpha; | 502 | m_focused_alpha = alpha; |
@@ -842,7 +850,7 @@ void FbWinFrame::reconfigure() { | |||
842 | m_bevel = theme()->bevelWidth(); | 850 | m_bevel = theme()->bevelWidth(); |
843 | setBorderWidth(); | 851 | setBorderWidth(); |
844 | 852 | ||
845 | if (m_state.deco_mask & DECORM_HANDLE && theme()->handleWidth() != 0) | 853 | if (useHandle() && theme()->handleWidth() != 0) |
846 | showHandle(); | 854 | showHandle(); |
847 | else | 855 | else |
848 | hideHandle(); | 856 | hideHandle(); |
@@ -1427,6 +1435,22 @@ int FbWinFrame::getDecoMaskFromString(const string &str_label) { | |||
1427 | return mask; | 1435 | return mask; |
1428 | } | 1436 | } |
1429 | 1437 | ||
1438 | bool FbWinFrame::useBorder() const { | ||
1439 | return !m_state.fullscreen && m_state.deco_mask & DECORM_BORDER; | ||
1440 | } | ||
1441 | |||
1442 | bool FbWinFrame::useTabs() const { | ||
1443 | return !m_state.fullscreen && m_state.deco_mask & DECORM_TAB; | ||
1444 | } | ||
1445 | |||
1446 | bool FbWinFrame::useTitlebar() const { | ||
1447 | return !m_state.fullscreen && m_state.deco_mask & DECORM_TITLEBAR; | ||
1448 | } | ||
1449 | |||
1450 | bool FbWinFrame::useHandle() const { | ||
1451 | return !m_state.fullscreen && m_state.deco_mask & DECORM_HANDLE; | ||
1452 | } | ||
1453 | |||
1430 | void FbWinFrame::applyDecorations() { | 1454 | void FbWinFrame::applyDecorations() { |
1431 | int grav_x=0, grav_y=0; | 1455 | int grav_x=0, grav_y=0; |
1432 | // negate gravity | 1456 | // negate gravity |
@@ -1438,13 +1462,13 @@ void FbWinFrame::applyDecorations() { | |||
1438 | // tab deocration only affects if we're external | 1462 | // tab deocration only affects if we're external |
1439 | // must do before the setTabMode in case it goes | 1463 | // must do before the setTabMode in case it goes |
1440 | // to external and is meant to be hidden | 1464 | // to external and is meant to be hidden |
1441 | if (m_state.deco_mask & DECORM_TAB) | 1465 | if (useTabs()) |
1442 | client_move |= showTabs(); | 1466 | client_move |= showTabs(); |
1443 | else | 1467 | else |
1444 | client_move |= hideTabs(); | 1468 | client_move |= hideTabs(); |
1445 | 1469 | ||
1446 | // we rely on frame not doing anything if it is already shown/hidden | 1470 | // we rely on frame not doing anything if it is already shown/hidden |
1447 | if (m_state.deco_mask & DECORM_TITLEBAR) { | 1471 | if (useTitlebar()) { |
1448 | client_move |= showTitlebar(); | 1472 | client_move |= showTitlebar(); |
1449 | if (m_screen.getDefaultInternalTabs()) | 1473 | if (m_screen.getDefaultInternalTabs()) |
1450 | client_move |= setTabMode(INTERNAL); | 1474 | client_move |= setTabMode(INTERNAL); |
@@ -1452,11 +1476,11 @@ void FbWinFrame::applyDecorations() { | |||
1452 | client_move |= setTabMode(EXTERNAL); | 1476 | client_move |= setTabMode(EXTERNAL); |
1453 | } else { | 1477 | } else { |
1454 | client_move |= hideTitlebar(); | 1478 | client_move |= hideTitlebar(); |
1455 | if (m_state.deco_mask & DECORM_TAB) | 1479 | if (useTabs()) |
1456 | client_move |= setTabMode(EXTERNAL); | 1480 | client_move |= setTabMode(EXTERNAL); |
1457 | } | 1481 | } |
1458 | 1482 | ||
1459 | if (m_state.deco_mask & DECORM_HANDLE) | 1483 | if (useHandle()) |
1460 | client_move |= showHandle(); | 1484 | client_move |= showHandle(); |
1461 | else | 1485 | else |
1462 | client_move |= hideHandle(); | 1486 | client_move |= hideHandle(); |
@@ -1478,7 +1502,7 @@ void FbWinFrame::applyDecorations() { | |||
1478 | 1502 | ||
1479 | bool FbWinFrame::setBorderWidth(bool do_move) { | 1503 | bool FbWinFrame::setBorderWidth(bool do_move) { |
1480 | unsigned int border_width = theme()->border().width(); | 1504 | unsigned int border_width = theme()->border().width(); |
1481 | unsigned int win_bw = m_state.deco_mask & DECORM_BORDER ? border_width : 0; | 1505 | unsigned int win_bw = useBorder() ? border_width : 0; |
1482 | 1506 | ||
1483 | if (border_width && | 1507 | if (border_width && |
1484 | theme()->border().color().pixel() != window().borderColor()) { | 1508 | theme()->border().color().pixel() != window().borderColor()) { |