summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-15 11:30:57 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-15 11:30:57 (GMT)
commitf32fdc29d28dce26f87e9f10f32e9399686766d8 (patch)
treed41429688ba9daaa7791081619932e48f9b2d8ae /src
parente5c61a72799485d6751000a127163bd6390d44ba (diff)
downloadfluxbox_lack-f32fdc29d28dce26f87e9f10f32e9399686766d8.zip
fluxbox_lack-f32fdc29d28dce26f87e9f10f32e9399686766d8.tar.bz2
have fullscreen and maximization code call applySizeHints directly
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.hh2
-rw-r--r--src/Window.cc35
-rw-r--r--src/Window.hh2
3 files changed, 11 insertions, 28 deletions
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 23a8141..3d61860 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -209,7 +209,7 @@ public:
209 void setSizeHints(const SizeHints &hint) { m_size_hints = hint; } 209 void setSizeHints(const SizeHints &hint) { m_size_hints = hint; }
210 210
211 void applySizeHints(unsigned int &width, unsigned int &height, 211 void applySizeHints(unsigned int &width, unsigned int &height,
212 bool maximizing) const; 212 bool maximizing = false) const;
213 void displaySize(unsigned int width, unsigned int height) const; 213 void displaySize(unsigned int width, unsigned int height) const;
214 214
215 void setDecorationMask(unsigned int mask) { m_decoration_mask = mask; } 215 void setDecorationMask(unsigned int mask) { m_decoration_mask = mask; }
diff --git a/src/Window.cc b/src/Window.cc
index ef6cd73..a5ec2dd 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1524,8 +1524,6 @@ void FluxboxWindow::setFullscreen(bool flag) {
1524 frame().moveResize(screen().getHeadX(head), screen().getHeadY(head), 1524 frame().moveResize(screen().getHeadX(head), screen().getHeadY(head),
1525 screen().getHeadWidth(head), screen().getHeadHeight(head)); 1525 screen().getHeadWidth(head), screen().getHeadHeight(head));
1526 sendConfigureNotify(); 1526 sendConfigureNotify();
1527 m_last_resize_x = frame().x();
1528 m_last_resize_y = frame().y();
1529 1527
1530 fullscreen = true; 1528 fullscreen = true;
1531 1529
@@ -1548,14 +1546,9 @@ void FluxboxWindow::setFullscreen(bool flag) {
1548 1546
1549 // ensure we apply the sizehints here, otherwise some 1547 // ensure we apply the sizehints here, otherwise some
1550 // apps (eg xterm) end up a little bit .. crappy (visually) 1548 // apps (eg xterm) end up a little bit .. crappy (visually)
1551 m_last_resize_x = m_old_pos_x; 1549 frame().applySizeHints(m_old_width, m_old_height);
1552 m_last_resize_y = m_old_pos_y;
1553 m_last_resize_w = m_old_width;
1554 m_last_resize_h = m_old_height;
1555 m_resize_corner = NOCORNER;
1556 fixsize();
1557 1550
1558 moveResize(m_last_resize_x, m_last_resize_y, m_last_resize_w, m_last_resize_h); 1551 moveResize(m_old_pos_x, m_old_pos_y, m_old_width, m_old_height);
1559 moveToLayer(m_old_layernum); 1552 moveToLayer(m_old_layernum);
1560 1553
1561 m_old_layernum = ::Layer::NORMAL; 1554 m_old_layernum = ::Layer::NORMAL;
@@ -1624,10 +1617,8 @@ void FluxboxWindow::setMaximizedState(int type) {
1624 stopResizing(); 1617 stopResizing();
1625 1618
1626 int head = screen().getHead(frame().window()); 1619 int head = screen().getHead(frame().window());
1627 int new_x = frame().x(), 1620 int new_x = frame().x(), new_y = frame().y();
1628 new_y = frame().y(), 1621 unsigned int new_w = frame().width(), new_h = frame().height();
1629 new_w = frame().width(),
1630 new_h = frame().height();
1631 1622
1632 // These evaluate whether we need to TOGGLE the value for that field 1623 // These evaluate whether we need to TOGGLE the value for that field
1633 // Why? If maximize is only set to zero outside this, 1624 // Why? If maximize is only set to zero outside this,
@@ -1679,22 +1670,14 @@ void FluxboxWindow::setMaximizedState(int type) {
1679 1670
1680 // ensure we apply the sizehints here, otherwise some 1671 // ensure we apply the sizehints here, otherwise some
1681 // apps (eg xterm) end up a little bit .. crappy (visually) 1672 // apps (eg xterm) end up a little bit .. crappy (visually)
1682 m_last_resize_x = new_x;
1683 m_last_resize_y = new_y;
1684 m_last_resize_w = new_w;
1685 m_last_resize_h = new_h;
1686 1673
1687 // frankly, that xterm bug was pretty obscure, and it's really annoying not 1674 // frankly, that xterm bug was pretty obscure, and it's really annoying not
1688 // being able to maximize my terminals, so we make an option 1675 // being able to maximize my terminals, so we make an option
1689 // but we do fix size hints when restoring the window to normal size 1676 // but we do fix size hints when restoring the window to normal size
1690 if (!screen().getMaxIgnoreIncrement() || !maximized) { 1677 if (!screen().getMaxIgnoreIncrement() || !maximized)
1691 ResizeDirection old_resize_corner = m_resize_corner; 1678 frame().applySizeHints(new_w, new_h, maximized ? true : false);
1692 m_resize_corner = NOCORNER;
1693 fixsize(maximized ? true : false);
1694 m_resize_corner = old_resize_corner;
1695 }
1696 1679
1697 moveResize(m_last_resize_x, m_last_resize_y, m_last_resize_w, m_last_resize_h); 1680 moveResize(new_x, new_y, new_w, new_h);
1698 1681
1699 // notify listeners that we changed state 1682 // notify listeners that we changed state
1700 stateSig().notify(); 1683 stateSig().notify();
@@ -3715,8 +3698,8 @@ unsigned int FluxboxWindow::normalHeight() const {
3715 3698
3716int FluxboxWindow::initialState() const { return m_client->initial_state; } 3699int FluxboxWindow::initialState() const { return m_client->initial_state; }
3717 3700
3718void FluxboxWindow::fixsize(bool maximizing) { 3701void FluxboxWindow::fixsize() {
3719 frame().applySizeHints(m_last_resize_w, m_last_resize_h, maximizing); 3702 frame().applySizeHints(m_last_resize_w, m_last_resize_h);
3720 3703
3721 // move X if necessary 3704 // move X if necessary
3722 if (m_resize_corner == LEFTTOP || m_resize_corner == LEFTBOTTOM || 3705 if (m_resize_corner == LEFTTOP || m_resize_corner == LEFTBOTTOM ||
diff --git a/src/Window.hh b/src/Window.hh
index 5129da8..05c4342 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -538,7 +538,7 @@ private:
538 // modifies left and top if snap is necessary 538 // modifies left and top if snap is necessary
539 void doSnapping(int &left, int &top); 539 void doSnapping(int &left, int &top);
540 // user_w/h return the values that should be shown to the user 540 // user_w/h return the values that should be shown to the user
541 void fixsize(bool maximizing = false); 541 void fixsize();
542 void moveResizeClient(WinClient &client, int x, int y, unsigned int width, unsigned int height); 542 void moveResizeClient(WinClient &client, int x, int y, unsigned int width, unsigned int height);
543 /// sends configurenotify to all clients 543 /// sends configurenotify to all clients
544 void sendConfigureNotify(); 544 void sendConfigureNotify();