From 2ddc0290cb7bed695afab3ca7e8b130b76e66793 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 2 Jul 2007 21:26:01 +0000 Subject: use old size/position in apps file when the window is shaded or maximized --- ChangeLog | 3 +++ src/FbWinFrame.cc | 6 ++++++ src/FbWinFrame.hh | 1 + src/Remember.cc | 4 ++-- src/Window.cc | 26 ++++++++++++++++++++++++++ src/Window.hh | 5 +++++ 6 files changed, 43 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6122c43..8b4a920 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 5a9a301..d3b3d2f 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 8d0c3ba..87c290c 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 12b5097..30a3e14 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 2434d31..af74074 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 d7d8910..d9e4a7c 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(); } -- cgit v0.11.2