diff options
author | markt <markt> | 2007-07-02 21:26:11 (GMT) |
---|---|---|
committer | markt <markt> | 2007-07-02 21:26:11 (GMT) |
commit | 163474a471f0a7a72a99a57c995c831b4a0af51b (patch) | |
tree | 51b2b721ceaa7b3f09b2f99fafe9c77c0c1bb31e | |
parent | 7e8c35211694cb98bfc8ac8e9ac3643795ac4624 (diff) | |
download | fluxbox-163474a471f0a7a72a99a57c995c831b4a0af51b.zip fluxbox-163474a471f0a7a72a99a57c995c831b4a0af51b.tar.bz2 |
use old size/position in apps file when window is shaded or maximized
-rw-r--r-- | src/FbWinFrame.cc | 6 | ||||
-rw-r--r-- | src/FbWinFrame.hh | 1 | ||||
-rw-r--r-- | src/Remember.cc | 4 | ||||
-rw-r--r-- | src/Window.cc | 26 | ||||
-rw-r--r-- | src/Window.hh | 5 |
5 files changed, 40 insertions, 2 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 6f9c86e..f699535 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -1669,6 +1669,12 @@ void FbWinFrame::gravityTranslate(int &x, int &y, | |||
1669 | } | 1669 | } |
1670 | } | 1670 | } |
1671 | 1671 | ||
1672 | unsigned int FbWinFrame::normalHeight() const { | ||
1673 | if (m_shaded) | ||
1674 | return m_height_before_shade; | ||
1675 | return height(); | ||
1676 | } | ||
1677 | |||
1672 | int FbWinFrame::widthOffset() const { | 1678 | int FbWinFrame::widthOffset() const { |
1673 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1679 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1674 | return 0; | 1680 | return 0; |
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index f83ec7d..4f42aab 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh | |||
@@ -203,6 +203,7 @@ public: | |||
203 | inline int y() const { return m_window.y(); } | 203 | inline int y() const { return m_window.y(); } |
204 | inline unsigned int width() const { return m_window.width(); } | 204 | inline unsigned int width() const { return m_window.width(); } |
205 | inline unsigned int height() const { return m_window.height(); } | 205 | inline unsigned int height() const { return m_window.height(); } |
206 | unsigned int normalHeight() const; | ||
206 | 207 | ||
207 | // extra bits for tabs | 208 | // extra bits for tabs |
208 | int xOffset() const; | 209 | int xOffset() const; |
diff --git a/src/Remember.cc b/src/Remember.cc index 2a94c6a..c490e51 100644 --- a/src/Remember.cc +++ b/src/Remember.cc | |||
@@ -905,13 +905,13 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) { | |||
905 | break; | 905 | break; |
906 | case REM_DIMENSIONS: | 906 | case REM_DIMENSIONS: |
907 | //!! Note: This is odd, why dont we need to substract border width on win->width() ? | 907 | //!! Note: This is odd, why dont we need to substract border width on win->width() ? |
908 | app->rememberDimensions(win->width(), win->height() - 2 * win->fbWindow().borderWidth()); | 908 | app->rememberDimensions(win->normalWidth(), win->normalHeight() - 2 * win->fbWindow().borderWidth()); |
909 | break; | 909 | break; |
910 | case REM_POSITION: { | 910 | case REM_POSITION: { |
911 | int head = win->screen().getHead(win->fbWindow()); | 911 | int head = win->screen().getHead(win->fbWindow()); |
912 | int head_x = win->screen().getHeadX(head); | 912 | int head_x = win->screen().getHeadX(head); |
913 | int head_y = win->screen().getHeadY(head); | 913 | int head_y = win->screen().getHeadY(head); |
914 | app->rememberPosition(win->x() - head_x, win->y() - head_y); | 914 | app->rememberPosition(win->normalX() - head_x, win->normalY() - head_y); |
915 | break; | 915 | break; |
916 | } | 916 | } |
917 | case REM_FOCUSHIDDENSTATE: | 917 | case REM_FOCUSHIDDENSTATE: |
diff --git a/src/Window.cc b/src/Window.cc index 4ddd8c8..e9d57c2 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -3782,6 +3782,32 @@ std::string FluxboxWindow::getWMRole() const { | |||
3782 | return (m_client ? m_client->getWMRole() : "FluxboxWindow"); | 3782 | return (m_client ? m_client->getWMRole() : "FluxboxWindow"); |
3783 | } | 3783 | } |
3784 | 3784 | ||
3785 | int FluxboxWindow::normalX() const { | ||
3786 | if (maximized & MAX_HORZ) | ||
3787 | return m_old_pos_x; | ||
3788 | return x(); | ||
3789 | } | ||
3790 | |||
3791 | int FluxboxWindow::normalY() const { | ||
3792 | if (maximized & MAX_VERT) | ||
3793 | return m_old_pos_y; | ||
3794 | return y(); | ||
3795 | } | ||
3796 | |||
3797 | unsigned int FluxboxWindow::normalWidth() const { | ||
3798 | if (maximized & MAX_HORZ) | ||
3799 | return m_old_width; | ||
3800 | return width(); | ||
3801 | } | ||
3802 | |||
3803 | unsigned int FluxboxWindow::normalHeight() const { | ||
3804 | if (maximized & MAX_VERT) | ||
3805 | return m_old_height; | ||
3806 | if (shaded) | ||
3807 | return frame().normalHeight(); | ||
3808 | return height(); | ||
3809 | } | ||
3810 | |||
3785 | int FluxboxWindow::initialState() const { return m_client->initial_state; } | 3811 | int FluxboxWindow::initialState() const { return m_client->initial_state; } |
3786 | 3812 | ||
3787 | void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) { | 3813 | void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) { |
diff --git a/src/Window.hh b/src/Window.hh index 6e04ded..fa5b305 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -450,6 +450,11 @@ public: | |||
450 | inline unsigned int width() const { return frame().width(); } | 450 | inline unsigned int width() const { return frame().width(); } |
451 | inline unsigned int height() const { return frame().height(); } | 451 | inline unsigned int height() const { return frame().height(); } |
452 | 452 | ||
453 | int normalX() const; | ||
454 | int normalY() const; | ||
455 | unsigned int normalWidth() const; | ||
456 | unsigned int normalHeight() const; | ||
457 | |||
453 | inline int xOffset() const { return frame().xOffset(); } | 458 | inline int xOffset() const { return frame().xOffset(); } |
454 | inline int yOffset() const { return frame().yOffset(); } | 459 | inline int yOffset() const { return frame().yOffset(); } |
455 | inline int widthOffset() const { return frame().widthOffset(); } | 460 | inline int widthOffset() const { return frame().widthOffset(); } |