summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc50
1 files changed, 14 insertions, 36 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 87d8d15..9f79649 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1611,7 +1611,8 @@ void FluxboxWindow::setFullscreen(bool flag) {
1611*/ 1611*/
1612void FluxboxWindow::maximize(int type) { 1612void FluxboxWindow::maximize(int type) {
1613 1613
1614 if (isFullscreen()) 1614 // doesn't make sense to maximize
1615 if (isFullscreen() || type == MAX_NONE)
1615 return; 1616 return;
1616 1617
1617 if (isIconic()) 1618 if (isIconic())
@@ -1640,26 +1641,11 @@ void FluxboxWindow::maximize(int type) {
1640 // Worst case being that some action will toggle the wrong way, but 1641 // Worst case being that some action will toggle the wrong way, but
1641 // we still won't lose the state in that case. 1642 // we still won't lose the state in that case.
1642 1643
1643 // NOTE: There is one option to the way this works - what it does when
1644 // fully maximised and maximise(vert, horz) is selected.
1645 // There are 2 options here - either:
1646 // 1) maximiseVertical results in a vertically (not horz) maximised window, or
1647 // 2) " toggles vertical maximisation, thus resulting in a horizontally
1648 // maximised window.
1649 //
1650 // The current implementation uses style 1, to change this, removed the
1651 // item corresponding to the [[ ]] comment
1652
1653 // toggle maximize vertically? 1644 // toggle maximize vertically?
1654 // when _don't_ we want to toggle? 1645 // when _don't_ we want to toggle?
1655 // - type is horizontal maximise, [[and we aren't fully maximised]] or 1646 // - type is horizontal maximise, or
1656 // - [[ type is vertical maximise and we are fully maximised ]] 1647 // - type is full and we are not maximised horz but already vertically
1657 // - type is none and we are not vertically maximised, or 1648 if (type != MAX_HORZ && !(type == MAX_FULL && orig_max == MAX_VERT)) {
1658 // - type is full and we are not horizontally maximised, but already vertically
1659 if (!(type == MAX_HORZ && orig_max != MAX_FULL ||
1660 type == MAX_VERT && orig_max == MAX_FULL ||
1661 type == MAX_NONE && !(orig_max & MAX_VERT) ||
1662 type == MAX_FULL && orig_max == MAX_VERT)) {
1663 // already maximized in that direction? 1649 // already maximized in that direction?
1664 if (orig_max & MAX_VERT) { 1650 if (orig_max & MAX_VERT) {
1665 new_y = m_old_pos_y; 1651 new_y = m_old_pos_y;
@@ -1678,10 +1664,7 @@ void FluxboxWindow::maximize(int type) {
1678 } 1664 }
1679 1665
1680 // maximize horizontally? 1666 // maximize horizontally?
1681 if (!(type == MAX_VERT && orig_max != MAX_FULL || 1667 if (type != MAX_VERT && !(type == MAX_FULL && orig_max == MAX_HORZ)) {
1682 type == MAX_HORZ && orig_max == MAX_FULL ||
1683 type == MAX_NONE && !(orig_max & MAX_HORZ) ||
1684 type == MAX_FULL && orig_max == MAX_HORZ)) {
1685 // already maximized in that direction? 1668 // already maximized in that direction?
1686 if (orig_max & MAX_HORZ) { 1669 if (orig_max & MAX_HORZ) {
1687 new_x = m_old_pos_x; 1670 new_x = m_old_pos_x;
@@ -1717,6 +1700,7 @@ void FluxboxWindow::maximize(int type) {
1717 // notify listeners that we changed state 1700 // notify listeners that we changed state
1718 stateSig().notify(); 1701 stateSig().notify();
1719} 1702}
1703
1720/** 1704/**
1721 * Maximize window horizontal 1705 * Maximize window horizontal
1722 */ 1706 */
@@ -3738,22 +3722,16 @@ void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) {
3738 want_max |= MAX_HORZ; 3722 want_max |= MAX_HORZ;
3739 3723
3740 if (want_max == MAX_NONE && maximized != MAX_NONE) { 3724 if (want_max == MAX_NONE && maximized != MAX_NONE) {
3741 maximize(MAX_NONE); 3725 maximize(maximized);
3742 } else if (want_max == MAX_FULL && maximized != MAX_FULL) { 3726 } else if (want_max == MAX_FULL && maximized != MAX_FULL) {
3743 maximize(MAX_FULL); 3727 maximize(MAX_FULL);
3744 // horz and vert are a little trickier to morph 3728 } else {
3745 }
3746 // to toggle vert
3747 // either we want vert and aren't 3729 // either we want vert and aren't
3748 // or we want horizontal, and are vertically (or full) at present 3730 // or we want horizontal and aren't
3749 if (want_max == MAX_VERT && !(maximized & MAX_VERT) || 3731 if (want_max == MAX_VERT ^ (bool)(maximized & MAX_VERT))
3750 want_max == MAX_HORZ && (maximized & MAX_VERT)) { 3732 maximize(MAX_VERT);
3751 maximize(MAX_VERT); 3733 if (want_max == MAX_HORZ ^ (bool)(maximized & MAX_HORZ))
3752 } 3734 maximize(MAX_HORZ);
3753 // note that if we want horz, it WONT be vert any more from above
3754 if (want_max == MAX_HORZ && !(maximized & MAX_HORZ) ||
3755 want_max == MAX_VERT && (maximized & MAX_HORZ)) {
3756 maximize(MAX_HORZ);
3757 } 3735 }
3758 } 3736 }
3759 3737