aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-05-12 20:38:20 (GMT)
committermarkt <markt>2007-05-12 20:38:20 (GMT)
commit39bb086128777b84ce2239c7d35995b722d6d0a3 (patch)
tree00a099711b312b68f8cbe076c6389cba8d39c842
parentaeafe360480c3f49895111e13438d640b33b1d96 (diff)
downloadfluxbox-39bb086128777b84ce2239c7d35995b722d6d0a3.zip
fluxbox-39bb086128777b84ce2239c7d35995b722d6d0a3.tar.bz2
changed interpretation of maximize horz/vert on maximized windows
-rw-r--r--ChangeLog3
-rw-r--r--src/Window.cc50
2 files changed, 17 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index dc89fbc..0dc4dde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1: 2Changes for 1.1:
3*07/05/12: 3*07/05/12:
4 * Changed interpretation of Horizontal/Vertical maximization of a window that
5 is already maximized (Mark)
6 Window.cc
4 * Fixed tabs disappearing with [Deco] {TAB} and tabs in titlebar (Mark) 7 * Fixed tabs disappearing with [Deco] {TAB} and tabs in titlebar (Mark)
5 Window.cc Screen.cc 8 Window.cc Screen.cc
6*07/05/04: 9*07/05/04:
diff --git a/src/Window.cc b/src/Window.cc
index a3999e3..b9e26bd 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1658,7 +1658,8 @@ void FluxboxWindow::setFullscreen(bool flag) {
1658*/ 1658*/
1659void FluxboxWindow::maximize(int type) { 1659void FluxboxWindow::maximize(int type) {
1660 1660
1661 if (isFullscreen()) 1661 // doesn't make sense to maximize
1662 if (isFullscreen() || type == MAX_NONE)
1662 return; 1663 return;
1663 1664
1664 if (isIconic()) 1665 if (isIconic())
@@ -1687,26 +1688,11 @@ void FluxboxWindow::maximize(int type) {
1687 // Worst case being that some action will toggle the wrong way, but 1688 // Worst case being that some action will toggle the wrong way, but
1688 // we still won't lose the state in that case. 1689 // we still won't lose the state in that case.
1689 1690
1690 // NOTE: There is one option to the way this works - what it does when
1691 // fully maximised and maximise(vert, horz) is selected.
1692 // There are 2 options here - either:
1693 // 1) maximiseVertical results in a vertically (not horz) maximised window, or
1694 // 2) " toggles vertical maximisation, thus resulting in a horizontally
1695 // maximised window.
1696 //
1697 // The current implementation uses style 1, to change this, removed the
1698 // item corresponding to the [[ ]] comment
1699
1700 // toggle maximize vertically? 1691 // toggle maximize vertically?
1701 // when _don't_ we want to toggle? 1692 // when _don't_ we want to toggle?
1702 // - type is horizontal maximise, [[and we aren't fully maximised]] or 1693 // - type is horizontal maximise, or
1703 // - [[ type is vertical maximise and we are fully maximised ]] 1694 // - type is full and we are not maximised horz but already vertically
1704 // - type is none and we are not vertically maximised, or 1695 if (type != MAX_HORZ && !(type == MAX_FULL && orig_max == MAX_VERT)) {
1705 // - type is full and we are not horizontally maximised, but already vertically
1706 if (!(type == MAX_HORZ && orig_max != MAX_FULL ||
1707 type == MAX_VERT && orig_max == MAX_FULL ||
1708 type == MAX_NONE && !(orig_max & MAX_VERT) ||
1709 type == MAX_FULL && orig_max == MAX_VERT)) {
1710 // already maximized in that direction? 1696 // already maximized in that direction?
1711 if (orig_max & MAX_VERT) { 1697 if (orig_max & MAX_VERT) {
1712 new_y = m_old_pos_y; 1698 new_y = m_old_pos_y;
@@ -1725,10 +1711,7 @@ void FluxboxWindow::maximize(int type) {
1725 } 1711 }
1726 1712
1727 // maximize horizontally? 1713 // maximize horizontally?
1728 if (!(type == MAX_VERT && orig_max != MAX_FULL || 1714 if (type != MAX_VERT && !(type == MAX_FULL && orig_max == MAX_HORZ)) {
1729 type == MAX_HORZ && orig_max == MAX_FULL ||
1730 type == MAX_NONE && !(orig_max & MAX_HORZ) ||
1731 type == MAX_FULL && orig_max == MAX_HORZ)) {
1732 // already maximized in that direction? 1715 // already maximized in that direction?
1733 if (orig_max & MAX_HORZ) { 1716 if (orig_max & MAX_HORZ) {
1734 new_x = m_old_pos_x; 1717 new_x = m_old_pos_x;
@@ -1769,6 +1752,7 @@ void FluxboxWindow::maximize(int type) {
1769 // notify listeners that we changed state 1752 // notify listeners that we changed state
1770 stateSig().notify(); 1753 stateSig().notify();
1771} 1754}
1755
1772/** 1756/**
1773 * Maximize window horizontal 1757 * Maximize window horizontal
1774 */ 1758 */
@@ -3757,22 +3741,16 @@ void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) {
3757 want_max |= MAX_HORZ; 3741 want_max |= MAX_HORZ;
3758 3742
3759 if (want_max == MAX_NONE && maximized != MAX_NONE) { 3743 if (want_max == MAX_NONE && maximized != MAX_NONE) {
3760 maximize(MAX_NONE); 3744 maximize(maximized);
3761 } else if (want_max == MAX_FULL && maximized != MAX_FULL) { 3745 } else if (want_max == MAX_FULL && maximized != MAX_FULL) {
3762 maximize(MAX_FULL); 3746 maximize(MAX_FULL);
3763 // horz and vert are a little trickier to morph 3747 } else {
3764 }
3765 // to toggle vert
3766 // either we want vert and aren't 3748 // either we want vert and aren't
3767 // or we want horizontal, and are vertically (or full) at present 3749 // or we want horizontal and aren't
3768 if (want_max == MAX_VERT && !(maximized & MAX_VERT) || 3750 if (want_max == MAX_VERT ^ (bool)(maximized & MAX_VERT))
3769 want_max == MAX_HORZ && (maximized & MAX_VERT)) { 3751 maximize(MAX_VERT);
3770 maximize(MAX_VERT); 3752 if (want_max == MAX_HORZ ^ (bool)(maximized & MAX_HORZ))
3771 } 3753 maximize(MAX_HORZ);
3772 // note that if we want horz, it WONT be vert any more from above
3773 if (want_max == MAX_HORZ && !(maximized & MAX_HORZ) ||
3774 want_max == MAX_VERT && (maximized & MAX_HORZ)) {
3775 maximize(MAX_HORZ);
3776 } 3754 }
3777 } 3755 }
3778 3756