diff --git a/ChangeLog b/ChangeLog index 6122c435..8b4a920a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.0.0: *07/07/02: + * Remember original size/position in apps file for shaded or maximized + windows (Mark) + Remember.cc Window.cc/hh FbWinFrame.cc/hh * Enabled Xinerama and Imlib2 support by default (Mark) configure.in * Fixed handle rendering when switching from a style without them (Mark) diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 5a9a3011..d3b3d2f1 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -1766,6 +1766,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 8d0c3ba9..87c290c4 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -206,6 +206,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 12b50971..30a3e14b 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 2434d312..af740741 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3735,6 +3735,32 @@ const string &FluxboxWindow::iconTitle() const { return m_client->iconTitle(); } +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 d7d89102..d9e4a7cc 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -389,6 +389,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(); }