aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-22 12:52:23 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-22 12:52:23 (GMT)
commit0ae3ca9e8a2a3398cf07789e0d141887d40dcb6f (patch)
tree4e4d66fc15fea3956106affb772ea28f3bc909dd /src
parent8681220f5361fef500d7eda28d9f22bbf0a006e4 (diff)
downloadfluxbox-0ae3ca9e8a2a3398cf07789e0d141887d40dcb6f.zip
fluxbox-0ae3ca9e8a2a3398cf07789e0d141887d40dcb6f.tar.bz2
move fullscreen and maximization handling to FbWinFrame
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc72
-rw-r--r--src/FbWinFrame.hh23
-rw-r--r--src/Remember.cc22
-rw-r--r--src/Window.cc158
-rw-r--r--src/Window.hh25
-rw-r--r--src/fluxbox.cc2
6 files changed, 129 insertions, 173 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index f050a6d..03f7420 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -529,8 +529,60 @@ void FbWinFrame::setFullscreen(bool newvalue) {
529 if (newvalue == m_state.fullscreen) 529 if (newvalue == m_state.fullscreen)
530 return; 530 return;
531 531
532 saveGeometry();
532 m_state.fullscreen = newvalue; 533 m_state.fullscreen = newvalue;
534 applyState();
535}
536
537void FbWinFrame::setMaximized(int value) {
538 if (value == m_state.maximized)
539 return;
540
541 saveGeometry();
542 m_state.maximized = value;
543 applyState();
544}
545
546void FbWinFrame::saveGeometry() {
547 if (m_state.fullscreen || m_state.maximized)
548 return;
549
550 m_state.x = x();
551 m_state.y = y();
552 m_state.width = width();
553 m_state.height = height();
554}
555
556void FbWinFrame::applyState() {
533 applyDecorations(); 557 applyDecorations();
558
559 if (m_state.fullscreen) {
560 const int head = m_screen.getHead(window());
561 moveResize(m_screen.getHeadX(head), m_screen.getHeadY(head),
562 m_screen.getHeadWidth(head), m_screen.getHeadHeight(head));
563 } else if (m_state.maximized) {
564 const int head = m_screen.getHead(window());
565 int new_x = m_state.x, new_y = m_state.y;
566 unsigned int new_w = m_state.width, new_h = m_state.height;
567 if (m_state.maximized & MAX_VERT) {
568 new_y = m_screen.maxTop(head);
569 new_h = m_screen.maxBottom(head) - new_y - 2*window().borderWidth();
570 }
571 if (m_state.maximized & MAX_HORZ) {
572 new_x = m_screen.maxLeft(head);
573 new_w = m_screen.maxRight(head) - new_x - 2*window().borderWidth();
574 }
575 if (!m_screen.getMaxOverTabs()) {
576 new_y += yOffset();
577 new_h -= heightOffset();
578 new_x += xOffset();
579 new_w -= widthOffset();
580 }
581 moveResize(new_x, new_y, new_w, new_h);
582 } else
583 moveResize(m_state.x, m_state.y, m_state.width, m_state.height);
584
585 frameExtentSig().notify();
534} 586}
535 587
536void FbWinFrame::setAlpha(bool focused, unsigned char alpha) { 588void FbWinFrame::setAlpha(bool focused, unsigned char alpha) {
@@ -1662,7 +1714,27 @@ void FbWinFrame::gravityTranslate(int &x, int &y,
1662 } 1714 }
1663} 1715}
1664 1716
1717int FbWinFrame::normalX() const {
1718 if ((m_state.maximized & MAX_HORZ) || m_state.fullscreen)
1719 return m_state.x;
1720 return x();
1721}
1722
1723int FbWinFrame::normalY() const {
1724 if ((m_state.maximized & MAX_VERT) || m_state.fullscreen)
1725 return m_state.y;
1726 return y();
1727}
1728
1729unsigned int FbWinFrame::normalWidth() const {
1730 if ((m_state.maximized & MAX_HORZ) || m_state.fullscreen)
1731 return m_state.width;
1732 return width();
1733}
1734
1665unsigned int FbWinFrame::normalHeight() const { 1735unsigned int FbWinFrame::normalHeight() const {
1736 if ((m_state.maximized & MAX_VERT) || m_state.fullscreen)
1737 return m_state.height;
1666 if (m_state.shaded) 1738 if (m_state.shaded)
1667 return m_height_before_shade; 1739 return m_height_before_shade;
1668 return height(); 1740 return height();
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 5756c8e..d2f7a1f 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -69,6 +69,16 @@ public:
69 }; 69 };
70 70
71 /** 71 /**
72 * Types of maximization
73 */
74 enum MaximizeMode {
75 MAX_NONE = 0, ///< normal state
76 MAX_HORZ = 1, ///< maximize horizontal
77 MAX_VERT = 2, ///< maximize vertical
78 MAX_FULL = 3 ///< maximize full
79 };
80
81 /**
72 This enumeration represents individual decoration 82 This enumeration represents individual decoration
73 attributes, they can be OR-d together to get a mask. 83 attributes, they can be OR-d together to get a mask.
74 Useful for saving. 84 Useful for saving.
@@ -126,12 +136,15 @@ public:
126 size_hints(), 136 size_hints(),
127 deco_mask(DECOR_NORMAL), 137 deco_mask(DECOR_NORMAL),
128 focused(false), 138 focused(false),
129 shaded(false), fullscreen(false), maximized(0) { } 139 shaded(false), fullscreen(false), maximized(0),
140 x(0), y(0), width(1), height(1) { }
130 141
131 SizeHints size_hints; 142 SizeHints size_hints;
132 unsigned int deco_mask; 143 unsigned int deco_mask;
133 bool focused, shaded, fullscreen; 144 bool focused, shaded, fullscreen;
134 int maximized; 145 int maximized;
146 int x, y;
147 unsigned int width, height;
135 }; 148 };
136 149
137 /// create a top level window 150 /// create a top level window
@@ -182,7 +195,7 @@ public:
182 /// set focus/unfocus style 195 /// set focus/unfocus style
183 void setFocus(bool newvalue); 196 void setFocus(bool newvalue);
184 void setFullscreen(bool value); 197 void setFullscreen(bool value);
185 void setMaximized(int value) { m_state.maximized = value; } 198 void setMaximized(int value);
186 199
187 void setFocusTitle(const std::string &str) { m_label.setText(str); } 200 void setFocusTitle(const std::string &str) { m_label.setText(str); }
188 bool setTabMode(TabMode tabmode); 201 bool setTabMode(TabMode tabmode);
@@ -237,6 +250,8 @@ public:
237 static int getDecoMaskFromString(const std::string &str); 250 static int getDecoMaskFromString(const std::string &str);
238 void setDecorationMask(unsigned int mask) { m_state.deco_mask = mask; } 251 void setDecorationMask(unsigned int mask) { m_state.deco_mask = mask; }
239 void applyDecorations(); 252 void applyDecorations();
253 void applyState();
254 void saveGeometry();
240 255
241 /// determine if the given decoration should be shown in current state 256 /// determine if the given decoration should be shown in current state
242 bool useBorder() const; 257 bool useBorder() const;
@@ -271,6 +286,10 @@ public:
271 int y() const { return m_window.y(); } 286 int y() const { return m_window.y(); }
272 unsigned int width() const { return m_window.width(); } 287 unsigned int width() const { return m_window.width(); }
273 unsigned int height() const { return m_window.height(); } 288 unsigned int height() const { return m_window.height(); }
289
290 int normalX() const;
291 int normalY() const;
292 unsigned int normalWidth() const;
274 unsigned int normalHeight() const; 293 unsigned int normalHeight() const;
275 294
276 // extra bits for tabs 295 // extra bits for tabs
diff --git a/src/Remember.cc b/src/Remember.cc
index a1f5d62..1df5045 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -535,13 +535,13 @@ int parseApp(ifstream &file, Application &app, string *first_line = 0) {
535 app.rememberMinimizedstate((strcasecmp(str_label.c_str(), "yes") == 0)); 535 app.rememberMinimizedstate((strcasecmp(str_label.c_str(), "yes") == 0));
536 } else if (str_key == "maximized") { 536 } else if (str_key == "maximized") {
537 if (strcasecmp(str_label.c_str(), "yes") == 0) 537 if (strcasecmp(str_label.c_str(), "yes") == 0)
538 app.rememberMaximizedstate(FluxboxWindow::MAX_FULL); 538 app.rememberMaximizedstate(FbWinFrame::MAX_FULL);
539 else if (strcasecmp(str_label.c_str(), "horz") == 0) 539 else if (strcasecmp(str_label.c_str(), "horz") == 0)
540 app.rememberMaximizedstate(FluxboxWindow::MAX_HORZ); 540 app.rememberMaximizedstate(FbWinFrame::MAX_HORZ);
541 else if (strcasecmp(str_label.c_str(), "vert") == 0) 541 else if (strcasecmp(str_label.c_str(), "vert") == 0)
542 app.rememberMaximizedstate(FluxboxWindow::MAX_VERT); 542 app.rememberMaximizedstate(FbWinFrame::MAX_VERT);
543 else 543 else
544 app.rememberMaximizedstate(FluxboxWindow::MAX_NONE); 544 app.rememberMaximizedstate(FbWinFrame::MAX_NONE);
545 } else if (str_key == "fullscreen") { 545 } else if (str_key == "fullscreen") {
546 app.rememberFullscreenstate((strcasecmp(str_label.c_str(), "yes") == 0)); 546 app.rememberFullscreenstate((strcasecmp(str_label.c_str(), "yes") == 0));
547 } else if (str_key == "jump") { 547 } else if (str_key == "jump") {
@@ -999,16 +999,16 @@ void Remember::save() {
999 if (a.maximizedstate_remember) { 999 if (a.maximizedstate_remember) {
1000 apps_file << " [Maximized]\t{"; 1000 apps_file << " [Maximized]\t{";
1001 switch (a.maximizedstate) { 1001 switch (a.maximizedstate) {
1002 case FluxboxWindow::MAX_FULL: 1002 case FbWinFrame::MAX_FULL:
1003 apps_file << "yes" << "}" << endl; 1003 apps_file << "yes" << "}" << endl;
1004 break; 1004 break;
1005 case FluxboxWindow::MAX_HORZ: 1005 case FbWinFrame::MAX_HORZ:
1006 apps_file << "horz" << "}" << endl; 1006 apps_file << "horz" << "}" << endl;
1007 break; 1007 break;
1008 case FluxboxWindow::MAX_VERT: 1008 case FbWinFrame::MAX_VERT:
1009 apps_file << "vert" << "}" << endl; 1009 apps_file << "vert" << "}" << endl;
1010 break; 1010 break;
1011 case FluxboxWindow::MAX_NONE: 1011 case FbWinFrame::MAX_NONE:
1012 default: 1012 default:
1013 apps_file << "no" << "}" << endl; 1013 apps_file << "no" << "}" << endl;
1014 break; 1014 break;
@@ -1115,13 +1115,15 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) {
1115 app->rememberHead(win->screen().getHead(win->fbWindow())); 1115 app->rememberHead(win->screen().getHead(win->fbWindow()));
1116 break; 1116 break;
1117 case REM_DIMENSIONS: 1117 case REM_DIMENSIONS:
1118 app->rememberDimensions(win->normalWidth(), win->normalHeight()); 1118 app->rememberDimensions(win->frame().normalWidth(),
1119 win->frame().normalHeight());
1119 break; 1120 break;
1120 case REM_POSITION: { 1121 case REM_POSITION: {
1121 int head = win->screen().getHead(win->fbWindow()); 1122 int head = win->screen().getHead(win->fbWindow());
1122 int head_x = win->screen().maxLeft(head); 1123 int head_x = win->screen().maxLeft(head);
1123 int head_y = win->screen().maxTop(head); 1124 int head_y = win->screen().maxTop(head);
1124 app->rememberPosition(win->normalX() - head_x, win->normalY() - head_y); 1125 app->rememberPosition(win->frame().normalX() - head_x,
1126 win->frame().normalY() - head_y);
1125 break; 1127 break;
1126 } 1128 }
1127 case REM_FOCUSHIDDENSTATE: 1129 case REM_FOCUSHIDDENSTATE:
diff --git a/src/Window.cc b/src/Window.cc
index 79419d0..c91e875 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -271,7 +271,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbTk::XLayer &layer):
271 m_creation_time(0), 271 m_creation_time(0),
272 moving(false), resizing(false), shaded(false), iconic(false), 272 moving(false), resizing(false), shaded(false), iconic(false),
273 stuck(false), m_initialized(false), fullscreen(false), 273 stuck(false), m_initialized(false), fullscreen(false),
274 maximized(MAX_NONE), 274 maximized(FbWinFrame::MAX_NONE),
275 m_attaching_tab(0), 275 m_attaching_tab(0),
276 display(FbTk::App::instance()->display()), 276 display(FbTk::App::instance()->display()),
277 m_button_grab_x(0), m_button_grab_y(0), 277 m_button_grab_x(0), m_button_grab_y(0),
@@ -287,8 +287,6 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbTk::XLayer &layer):
287 m_focus_new(BoolAcc(screen().focusControl(), &FocusControl::focusNew)), 287 m_focus_new(BoolAcc(screen().focusControl(), &FocusControl::focusNew)),
288 m_mouse_focus(BoolAcc(screen().focusControl(), &FocusControl::isMouseFocus)), 288 m_mouse_focus(BoolAcc(screen().focusControl(), &FocusControl::isMouseFocus)),
289 m_click_focus(true), 289 m_click_focus(true),
290 m_old_pos_x(0), m_old_pos_y(0),
291 m_old_width(1), m_old_height(1),
292 m_last_button_x(0), m_last_button_y(0), 290 m_last_button_x(0), m_last_button_y(0),
293 m_button_theme(*this, screen().focusedWinButtonTheme(), 291 m_button_theme(*this, screen().focusedWinButtonTheme(),
294 screen().unfocusedWinButtonTheme()), 292 screen().unfocusedWinButtonTheme()),
@@ -561,7 +559,7 @@ void FluxboxWindow::init() {
561 559
562 if (maximized) { 560 if (maximized) {
563 int tmp = maximized; 561 int tmp = maximized;
564 maximized = MAX_NONE; 562 maximized = FbWinFrame::MAX_NONE;
565 setMaximizedState(tmp); 563 setMaximizedState(tmp);
566 } 564 }
567 565
@@ -1444,35 +1442,16 @@ void FluxboxWindow::setFullscreen(bool flag) {
1444 return; 1442 return;
1445 } 1443 }
1446 1444
1447 const int head = screen().getHead(fbWindow());
1448
1449 if (flag && !isFullscreen()) { 1445 if (flag && !isFullscreen()) {
1450 1446
1451 if (isShaded()) 1447 if (isShaded())
1452 shade(); 1448 shade();
1453 1449
1454 m_old_layernum = layerNum(); 1450 m_old_layernum = layerNum();
1455 if (!maximized) {
1456 m_old_pos_x = frame().x();
1457 m_old_pos_y = frame().y();
1458 m_old_width = frame().width();
1459 m_old_height = frame().height();
1460 }
1461
1462 fullscreen = true; 1451 fullscreen = true;
1463 frame().setFullscreen(true); 1452 frame().setFullscreen(true);
1464 1453
1465 // dont call Window::moveResize here, it might ignore the 1454 setFullscreenLayer(); // calls stateSig().notify()
1466 // resize if win state is not resizable;
1467 // instead we call frame resize directly
1468 // (see tests/fullscreentest.cc)
1469
1470 // be xinerama aware
1471 frame().moveResize(screen().getHeadX(head), screen().getHeadY(head),
1472 screen().getHeadWidth(head), screen().getHeadHeight(head));
1473 sendConfigureNotify();
1474
1475 setFullscreenLayer();
1476 if (!isFocused()) 1455 if (!isFocused())
1477 screen().focusedWindowSig().attach(this); 1456 screen().focusedWindowSig().attach(this);
1478 1457
@@ -1481,21 +1460,8 @@ void FluxboxWindow::setFullscreen(bool flag) {
1481 fullscreen = false; 1460 fullscreen = false;
1482 frame().setFullscreen(false); 1461 frame().setFullscreen(false);
1483 1462
1484 // ensure we apply the sizehints here, otherwise some
1485 // apps (eg xterm) end up a little bit .. crappy (visually)
1486 frame().applySizeHints(m_old_width, m_old_height);
1487
1488 moveResize(m_old_pos_x, m_old_pos_y, m_old_width, m_old_height);
1489 moveToLayer(m_old_layernum); 1463 moveToLayer(m_old_layernum);
1490 1464 stateSig().notify();
1491 m_old_layernum = ::Layer::NORMAL;
1492
1493 if (maximized) {
1494 int tmp = maximized;
1495 maximized = MAX_NONE;
1496 setMaximizedState(tmp);
1497 } else
1498 stateSig().notify();
1499 } 1465 }
1500} 1466}
1501 1467
@@ -1507,8 +1473,7 @@ void FluxboxWindow::setFullscreenLayer() {
1507 getOnHead() != foc->getOnHead()) { 1473 getOnHead() != foc->getOnHead()) {
1508 moveToLayer(::Layer::ABOVE_DOCK); 1474 moveToLayer(::Layer::ABOVE_DOCK);
1509 } else { 1475 } else {
1510 moveToLayer(m_old_layernum); 1476 moveToLayer(::Layer::DESKTOP);
1511 lower();
1512 } 1477 }
1513 stateSig().notify(); 1478 stateSig().notify();
1514 1479
@@ -1520,7 +1485,7 @@ void FluxboxWindow::setFullscreenLayer() {
1520void FluxboxWindow::maximize(int type) { 1485void FluxboxWindow::maximize(int type) {
1521 1486
1522 // nothing to do 1487 // nothing to do
1523 if (type == MAX_NONE) 1488 if (type == FbWinFrame::MAX_NONE)
1524 return; 1489 return;
1525 1490
1526 int new_max = maximized; 1491 int new_max = maximized;
@@ -1529,19 +1494,21 @@ void FluxboxWindow::maximize(int type) {
1529 // when _don't_ we want to toggle? 1494 // when _don't_ we want to toggle?
1530 // - type is horizontal maximise, or 1495 // - type is horizontal maximise, or
1531 // - type is full and we are not maximised horz but already vertically 1496 // - type is full and we are not maximised horz but already vertically
1532 if (type != MAX_HORZ && !(type == MAX_FULL && maximized == MAX_VERT)) 1497 if (type != FbWinFrame::MAX_HORZ &&
1533 new_max ^= MAX_VERT; 1498 (type != FbWinFrame::MAX_FULL || maximized != FbWinFrame::MAX_VERT))
1499 new_max ^= FbWinFrame::MAX_VERT;
1534 1500
1535 // maximize horizontally? 1501 // maximize horizontally?
1536 if (type != MAX_VERT && !(type == MAX_FULL && maximized == MAX_HORZ)) 1502 if (type != FbWinFrame::MAX_VERT &&
1537 new_max ^= MAX_HORZ; 1503 (type != FbWinFrame::MAX_FULL || maximized != FbWinFrame::MAX_HORZ))
1504 new_max ^= FbWinFrame::MAX_HORZ;
1538 1505
1539 setMaximizedState(new_max); 1506 setMaximizedState(new_max);
1540} 1507}
1541 1508
1542void FluxboxWindow::setMaximizedState(int type) { 1509void FluxboxWindow::setMaximizedState(int type) {
1543 1510
1544 if (!m_initialized || isFullscreen() || type == maximized) { 1511 if (!m_initialized || type == maximized) {
1545 // this will interfere with window placement, so we delay it 1512 // this will interfere with window placement, so we delay it
1546 maximized = type; 1513 maximized = type;
1547 return; 1514 return;
@@ -1553,69 +1520,8 @@ void FluxboxWindow::setMaximizedState(int type) {
1553 if (isResizing()) 1520 if (isResizing())
1554 stopResizing(); 1521 stopResizing();
1555 1522
1556 int head = screen().getHead(frame().window()); 1523 maximized = type;
1557 int new_x = frame().x(), new_y = frame().y(); 1524 frame().setMaximized(type);
1558 unsigned int new_w = frame().width(), new_h = frame().height();
1559
1560 // These evaluate whether we need to TOGGLE the value for that field
1561 // Why? If maximize is only set to zero outside this,
1562 // and we only EVER toggle them, then:
1563 // 1) We will never loose the old_ values
1564 // 2) It shouldn't get confused
1565
1566 // Worst case being that some action will toggle the wrong way, but
1567 // we still won't lose the state in that case.
1568
1569 // toggle maximize vertically?
1570 if ((maximized ^ type) & MAX_VERT) {
1571 // already maximized in that direction?
1572 if (maximized & MAX_VERT) {
1573 new_y = m_old_pos_y;
1574 new_h = m_old_height;
1575 } else {
1576 m_old_pos_y = new_y;
1577 m_old_height = new_h;
1578 new_y = screen().maxTop(head);
1579 new_h = screen().maxBottom(head) - new_y - 2*frame().window().borderWidth();
1580 if (!screen().getMaxOverTabs()) {
1581 new_y += yOffset();
1582 new_h -= heightOffset();
1583 }
1584 }
1585 maximized ^= MAX_VERT;
1586 }
1587
1588 // toggle maximize horizontally?
1589 if ((maximized ^ type) & MAX_HORZ) {
1590 // already maximized in that direction?
1591 if (maximized & MAX_HORZ) {
1592 new_x = m_old_pos_x;
1593 new_w = m_old_width;
1594 } else {
1595 // only save if we weren't already maximized
1596 m_old_pos_x = new_x;
1597 m_old_width = new_w;
1598 new_x = screen().maxLeft(head);
1599 new_w = screen().maxRight(head) - new_x - 2*frame().window().borderWidth();
1600 if (!screen().getMaxOverTabs()) {
1601 new_x += xOffset();
1602 new_w -= widthOffset();
1603 }
1604 }
1605 maximized ^= MAX_HORZ;
1606 }
1607
1608 frame().setMaximized(maximized);
1609 // ensure we apply the sizehints here, otherwise some
1610 // apps (eg xterm) end up a little bit .. crappy (visually)
1611
1612 // frankly, that xterm bug was pretty obscure, and it's really annoying not
1613 // being able to maximize my terminals, so we make an option
1614 // but we do fix size hints when restoring the window to normal size
1615 if (!screen().getMaxIgnoreIncrement() || !maximized)
1616 frame().applySizeHints(new_w, new_h, maximized ? true : false);
1617
1618 moveResize(new_x, new_y, new_w, new_h);
1619 1525
1620 // notify listeners that we changed state 1526 // notify listeners that we changed state
1621 stateSig().notify(); 1527 stateSig().notify();
@@ -1625,21 +1531,21 @@ void FluxboxWindow::setMaximizedState(int type) {
1625 * Maximize window horizontal 1531 * Maximize window horizontal
1626 */ 1532 */
1627void FluxboxWindow::maximizeHorizontal() { 1533void FluxboxWindow::maximizeHorizontal() {
1628 maximize(MAX_HORZ); 1534 maximize(FbWinFrame::MAX_HORZ);
1629} 1535}
1630 1536
1631/** 1537/**
1632 * Maximize window vertical 1538 * Maximize window vertical
1633 */ 1539 */
1634void FluxboxWindow::maximizeVertical() { 1540void FluxboxWindow::maximizeVertical() {
1635 maximize(MAX_VERT); 1541 maximize(FbWinFrame::MAX_VERT);
1636} 1542}
1637 1543
1638/** 1544/**
1639 * Maximize window fully 1545 * Maximize window fully
1640 */ 1546 */
1641void FluxboxWindow::maximizeFull() { 1547void FluxboxWindow::maximizeFull() {
1642 maximize(MAX_FULL); 1548 maximize(FbWinFrame::MAX_FULL);
1643} 1549}
1644 1550
1645void FluxboxWindow::setWorkspace(int n) { 1551void FluxboxWindow::setWorkspace(int n) {
@@ -3248,7 +3154,7 @@ void FluxboxWindow::startResizing(int x, int y, ReferenceCorner dir) {
3248 m_resize_corner = dir; 3154 m_resize_corner = dir;
3249 3155
3250 resizing = true; 3156 resizing = true;
3251 maximized = MAX_NONE; 3157 maximized = FbWinFrame::MAX_NONE;
3252 frame().setMaximized(maximized); 3158 frame().setMaximized(maximized);
3253 3159
3254 const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() : 3160 const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() :
@@ -3541,32 +3447,6 @@ bool FluxboxWindow::isTransient() const {
3541 return (m_client && m_client->isTransient()); 3447 return (m_client && m_client->isTransient());
3542} 3448}
3543 3449
3544int FluxboxWindow::normalX() const {
3545 if (maximized & MAX_HORZ || fullscreen)
3546 return m_old_pos_x;
3547 return x();
3548}
3549
3550int FluxboxWindow::normalY() const {
3551 if (maximized & MAX_VERT || fullscreen)
3552 return m_old_pos_y;
3553 return y();
3554}
3555
3556unsigned int FluxboxWindow::normalWidth() const {
3557 if (maximized & MAX_HORZ || fullscreen)
3558 return m_old_width;
3559 return width();
3560}
3561
3562unsigned int FluxboxWindow::normalHeight() const {
3563 if (maximized & MAX_VERT || fullscreen)
3564 return m_old_height;
3565 if (shaded)
3566 return frame().normalHeight();
3567 return height();
3568}
3569
3570int FluxboxWindow::initialState() const { return m_client->initial_state; } 3450int FluxboxWindow::initialState() const { return m_client->initial_state; }
3571 3451
3572void FluxboxWindow::fixsize() { 3452void FluxboxWindow::fixsize() {
diff --git a/src/Window.hh b/src/Window.hh
index 5cf755e..16d5bc9 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -87,16 +87,6 @@ public:
87 MwmDecorMaximize = (1l << 6) /// maximize 87 MwmDecorMaximize = (1l << 6) /// maximize
88 }; 88 };
89 89
90 /**
91 * Types of maximization
92 */
93 enum MaximizeMode {
94 MAX_NONE = 0, ///< normal state
95 MAX_HORZ = 1, ///< maximize horizontal
96 MAX_VERT = 2, ///< maximize vertical
97 MAX_FULL = 3 ///< maximize full
98 };
99
100 /// Different resize modes when resizing a window 90 /// Different resize modes when resizing a window
101 enum ResizeModel { 91 enum ResizeModel {
102 QUADRANTRESIZE, ///< resizes from one quadrant 92 QUADRANTRESIZE, ///< resizes from one quadrant
@@ -222,7 +212,7 @@ public:
222 /// set fullscreen 212 /// set fullscreen
223 void setFullscreen(bool flag); 213 void setFullscreen(bool flag);
224 /// toggle maximize 214 /// toggle maximize
225 void maximize(int type = MAX_FULL); 215 void maximize(int type = FbWinFrame::MAX_FULL);
226 /// sets the maximized state 216 /// sets the maximized state
227 void setMaximizedState(int type); 217 void setMaximizedState(int type);
228 /// maximizes the window horizontal 218 /// maximizes the window horizontal
@@ -383,9 +373,9 @@ public:
383 bool isIconic() const { return iconic; } 373 bool isIconic() const { return iconic; }
384 bool isShaded() const { return shaded; } 374 bool isShaded() const { return shaded; }
385 bool isFullscreen() const { return fullscreen; } 375 bool isFullscreen() const { return fullscreen; }
386 bool isMaximized() const { return maximized == MAX_FULL; } 376 bool isMaximized() const { return maximized == FbWinFrame::MAX_FULL; }
387 bool isMaximizedVert() const { return (bool)(maximized & MAX_VERT); } 377 bool isMaximizedVert() const { return (bool)(maximized & FbWinFrame::MAX_VERT); }
388 bool isMaximizedHorz() const { return (bool)(maximized & MAX_HORZ); } 378 bool isMaximizedHorz() const { return (bool)(maximized & FbWinFrame::MAX_HORZ); }
389 int maximizedState() const { return maximized; } 379 int maximizedState() const { return maximized; }
390 bool isIconifiable() const { return functions.iconify; } 380 bool isIconifiable() const { return functions.iconify; }
391 bool isMaximizable() const { return functions.maximize; } 381 bool isMaximizable() const { return functions.maximize; }
@@ -435,11 +425,6 @@ public:
435 unsigned int width() const { return frame().width(); } 425 unsigned int width() const { return frame().width(); }
436 unsigned int height() const { return frame().height(); } 426 unsigned int height() const { return frame().height(); }
437 427
438 int normalX() const;
439 int normalY() const;
440 unsigned int normalWidth() const;
441 unsigned int normalHeight() const;
442
443 int xOffset() const { return frame().xOffset(); } 428 int xOffset() const { return frame().xOffset(); }
444 int yOffset() const { return frame().yOffset(); } 429 int yOffset() const { return frame().yOffset(); }
445 int widthOffset() const { return frame().widthOffset(); } 430 int widthOffset() const { return frame().widthOffset(); }
@@ -587,8 +572,6 @@ private:
587 /// if the window is focused with EnterNotify 572 /// if the window is focused with EnterNotify
588 FbTk::DefaultValue<bool, BoolAcc> m_mouse_focus; 573 FbTk::DefaultValue<bool, BoolAcc> m_mouse_focus;
589 bool m_click_focus; ///< if the window is focused by clicking 574 bool m_click_focus; ///< if the window is focused by clicking
590 int m_old_pos_x, m_old_pos_y; ///< old position so we can restore from maximized
591 unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state
592 int m_last_button_x, ///< last known x position of the mouse button 575 int m_last_button_x, ///< last known x position of the mouse button
593 m_last_button_y; ///< last known y position of the mouse button 576 m_last_button_y; ///< last known y position of the mouse button
594 577
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index d9deea7..5056624 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -263,7 +263,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
263 m_reconfig_timer.setCommand(reconfig_cmd); 263 m_reconfig_timer.setCommand(reconfig_cmd);
264 m_reconfig_timer.fireOnce(true); 264 m_reconfig_timer.fireOnce(true);
265 265
266 // XSynchronize(disp, True); 266 XSynchronize(disp, True);
267 267
268 s_singleton = this; 268 s_singleton = this;
269 m_have_shape = false; 269 m_have_shape = false;