diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-27 20:29:35 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-27 20:29:35 (GMT) |
commit | a2ec0c9bdd9ebcc713426a79209b9ca90b4db301 (patch) | |
tree | 3d7b659c38f3b01e4e09a4887dc7b7cf1f73689b /src/WindowState.cc | |
parent | 84c87a86f9365014b7425c56a2a1051c102df804 (diff) | |
download | fluxbox-a2ec0c9bdd9ebcc713426a79209b9ca90b4db301.zip fluxbox-a2ec0c9bdd9ebcc713426a79209b9ca90b4db301.tar.bz2 |
make FbWinFrame and FluxboxWindow share a WindowState object
Diffstat (limited to 'src/WindowState.cc')
-rw-r--r-- | src/WindowState.cc | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/WindowState.cc b/src/WindowState.cc index f4df136..50a88fc 100644 --- a/src/WindowState.cc +++ b/src/WindowState.cc | |||
@@ -43,21 +43,41 @@ bool WindowState::useTitlebar() const { | |||
43 | } | 43 | } |
44 | 44 | ||
45 | void WindowState::saveGeometry(int new_x, int new_y, | 45 | void WindowState::saveGeometry(int new_x, int new_y, |
46 | unsigned int new_w, unsigned int new_h) { | 46 | unsigned int new_w, unsigned int new_h, |
47 | if (fullscreen || maximized == MAX_FULL) | 47 | bool force) { |
48 | if ((fullscreen || maximized == MAX_FULL) && !force) | ||
48 | return; | 49 | return; |
49 | 50 | ||
50 | if (!(maximized & MAX_HORZ)) { | 51 | if (!(maximized & MAX_HORZ) || force) { |
51 | x = new_x; | 52 | x = new_x; |
52 | width = new_w; | 53 | width = new_w; |
53 | } | 54 | } |
54 | if (!(maximized & MAX_VERT)) { | 55 | if (!(maximized & MAX_VERT) || force) { |
55 | y = new_y; | 56 | y = new_y; |
56 | if (!shaded) | 57 | if (!shaded || force) |
57 | height = new_h; | 58 | height = new_h; |
58 | } | 59 | } |
59 | } | 60 | } |
60 | 61 | ||
62 | int WindowState::queryToggleMaximized(int type) const { | ||
63 | if (type == MAX_NONE) | ||
64 | return maximized; | ||
65 | |||
66 | int new_max = maximized; | ||
67 | // toggle maximize vertically? | ||
68 | // when _don't_ we want to toggle? | ||
69 | // - type is horizontal maximize, or | ||
70 | // - type is full and we are not maximized horz but already vertically | ||
71 | if (type != MAX_HORZ && (type != MAX_FULL || maximized != MAX_VERT)) | ||
72 | new_max ^= MAX_VERT; | ||
73 | |||
74 | // maximize horizontally? | ||
75 | if (type != MAX_VERT && (type != MAX_FULL || maximized != MAX_HORZ)) | ||
76 | new_max ^= MAX_HORZ; | ||
77 | |||
78 | return new_max; | ||
79 | } | ||
80 | |||
61 | int WindowState::getDecoMaskFromString(const std::string &str_label) { | 81 | int WindowState::getDecoMaskFromString(const std::string &str_label) { |
62 | std::string label = FbTk::StringUtil::toLower(str_label); | 82 | std::string label = FbTk::StringUtil::toLower(str_label); |
63 | if (label == "none") | 83 | if (label == "none") |