summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-07-02 21:26:01 (GMT)
committermarkt <markt>2007-07-02 21:26:01 (GMT)
commit2ddc0290cb7bed695afab3ca7e8b130b76e66793 (patch)
tree78f48421785e39e696e6fed602484af91555e4e4
parentb00d53eb728532bb9bb8cc386008532f31aed657 (diff)
downloadfluxbox_lack-2ddc0290cb7bed695afab3ca7e8b130b76e66793.zip
fluxbox_lack-2ddc0290cb7bed695afab3ca7e8b130b76e66793.tar.bz2
use old size/position in apps file when the window is shaded or maximized
-rw-r--r--ChangeLog3
-rw-r--r--src/FbWinFrame.cc6
-rw-r--r--src/FbWinFrame.hh1
-rw-r--r--src/Remember.cc4
-rw-r--r--src/Window.cc26
-rw-r--r--src/Window.hh5
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 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0.0: 2Changes for 1.0.0:
3*07/07/02: 3*07/07/02:
4 * Remember original size/position in apps file for shaded or maximized
5 windows (Mark)
6 Remember.cc Window.cc/hh FbWinFrame.cc/hh
4 * Enabled Xinerama and Imlib2 support by default (Mark) 7 * Enabled Xinerama and Imlib2 support by default (Mark)
5 configure.in 8 configure.in
6 * Fixed handle rendering when switching from a style without them (Mark) 9 * 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,
1766 } 1766 }
1767} 1767}
1768 1768
1769unsigned int FbWinFrame::normalHeight() const {
1770 if (m_shaded)
1771 return m_height_before_shade;
1772 return height();
1773}
1774
1769int FbWinFrame::widthOffset() const { 1775int FbWinFrame::widthOffset() const {
1770 if (m_tabmode != EXTERNAL || !m_use_tabs) 1776 if (m_tabmode != EXTERNAL || !m_use_tabs)
1771 return 0; 1777 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:
206 inline int y() const { return m_window.y(); } 206 inline int y() const { return m_window.y(); }
207 inline unsigned int width() const { return m_window.width(); } 207 inline unsigned int width() const { return m_window.width(); }
208 inline unsigned int height() const { return m_window.height(); } 208 inline unsigned int height() const { return m_window.height(); }
209 unsigned int normalHeight() const;
209 210
210 // extra bits for tabs 211 // extra bits for tabs
211 int xOffset() const; 212 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) {
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 2434d31..af74074 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3735,6 +3735,32 @@ const string &FluxboxWindow::iconTitle() const {
3735 return m_client->iconTitle(); 3735 return m_client->iconTitle();
3736} 3736}
3737 3737
3738int FluxboxWindow::normalX() const {
3739 if (maximized & MAX_HORZ)
3740 return m_old_pos_x;
3741 return x();
3742}
3743
3744int FluxboxWindow::normalY() const {
3745 if (maximized & MAX_VERT)
3746 return m_old_pos_y;
3747 return y();
3748}
3749
3750unsigned int FluxboxWindow::normalWidth() const {
3751 if (maximized & MAX_HORZ)
3752 return m_old_width;
3753 return width();
3754}
3755
3756unsigned int FluxboxWindow::normalHeight() const {
3757 if (maximized & MAX_VERT)
3758 return m_old_height;
3759 if (shaded)
3760 return frame().normalHeight();
3761 return height();
3762}
3763
3738int FluxboxWindow::initialState() const { return m_client->initial_state; } 3764int FluxboxWindow::initialState() const { return m_client->initial_state; }
3739 3765
3740void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) { 3766void 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:
389 inline unsigned int width() const { return frame().width(); } 389 inline unsigned int width() const { return frame().width(); }
390 inline unsigned int height() const { return frame().height(); } 390 inline unsigned int height() const { return frame().height(); }
391 391
392 int normalX() const;
393 int normalY() const;
394 unsigned int normalWidth() const;
395 unsigned int normalHeight() const;
396
392 inline int xOffset() const { return frame().xOffset(); } 397 inline int xOffset() const { return frame().xOffset(); }
393 inline int yOffset() const { return frame().yOffset(); } 398 inline int yOffset() const { return frame().yOffset(); }
394 inline int widthOffset() const { return frame().widthOffset(); } 399 inline int widthOffset() const { return frame().widthOffset(); }