From 163474a471f0a7a72a99a57c995c831b4a0af51b Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 2 Jul 2007 21:26:11 +0000 Subject: use old size/position in apps file when window is shaded or maximized --- src/FbWinFrame.cc | 6 ++++++ src/FbWinFrame.hh | 1 + src/Remember.cc | 4 ++-- src/Window.cc | 26 ++++++++++++++++++++++++++ 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, } } +unsigned int FbWinFrame::normalHeight() const { + if (m_shaded) + return m_height_before_shade; + return height(); +} + int FbWinFrame::widthOffset() const { if (m_tabmode != EXTERNAL || !m_use_tabs) 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: inline int y() const { return m_window.y(); } inline unsigned int width() const { return m_window.width(); } inline unsigned int height() const { return m_window.height(); } + unsigned int normalHeight() const; // extra bits for tabs 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) { break; case REM_DIMENSIONS: //!! Note: This is odd, why dont we need to substract border width on win->width() ? - app->rememberDimensions(win->width(), win->height() - 2 * win->fbWindow().borderWidth()); + app->rememberDimensions(win->normalWidth(), win->normalHeight() - 2 * win->fbWindow().borderWidth()); break; case REM_POSITION: { int head = win->screen().getHead(win->fbWindow()); int head_x = win->screen().getHeadX(head); int head_y = win->screen().getHeadY(head); - app->rememberPosition(win->x() - head_x, win->y() - head_y); + app->rememberPosition(win->normalX() - head_x, win->normalY() - head_y); break; } 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 { return (m_client ? m_client->getWMRole() : "FluxboxWindow"); } +int FluxboxWindow::normalX() const { + if (maximized & MAX_HORZ) + return m_old_pos_x; + return x(); +} + +int FluxboxWindow::normalY() const { + if (maximized & MAX_VERT) + return m_old_pos_y; + return y(); +} + +unsigned int FluxboxWindow::normalWidth() const { + if (maximized & MAX_HORZ) + return m_old_width; + return width(); +} + +unsigned int FluxboxWindow::normalHeight() const { + if (maximized & MAX_VERT) + return m_old_height; + if (shaded) + return frame().normalHeight(); + return height(); +} + int FluxboxWindow::initialState() const { return m_client->initial_state; } 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: inline unsigned int width() const { return frame().width(); } inline unsigned int height() const { return frame().height(); } + int normalX() const; + int normalY() const; + unsigned int normalWidth() const; + unsigned int normalHeight() const; + inline int xOffset() const { return frame().xOffset(); } inline int yOffset() const { return frame().yOffset(); } inline int widthOffset() const { return frame().widthOffset(); } -- cgit v0.11.2