aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-09-12 22:49:14 (GMT)
committerfluxgen <fluxgen>2003-09-12 22:49:14 (GMT)
commita6b3e25679d80c7d703682a85692f75a8f6a8f75 (patch)
treeeae33d9a82323eb0bb2168a756679fb8af4dcc97 /src/Window.cc
parent48ea10e22f74e2718578dbf4634f059cbe59fa9f (diff)
downloadfluxbox-a6b3e25679d80c7d703682a85692f75a8f6a8f75.zip
fluxbox-a6b3e25679d80c7d703682a85692f75a8f6a8f75.tar.bz2
optimized rendering
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/Window.cc b/src/Window.cc
index cd97f16..1781dbf 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.225 2003/09/11 21:30:20 rathnor Exp $ 25// $Id: Window.cc,v 1.226 2003/09/12 22:48:49 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -362,7 +362,7 @@ void FluxboxWindow::init() {
362 frame().gripLeft().setCursor(frame().theme().lowerLeftAngleCursor()); 362 frame().gripLeft().setCursor(frame().theme().lowerLeftAngleCursor());
363 frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor()); 363 frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor());
364 364
365 frame().resize(m_client->width(), m_client->height()); 365
366 FbTk::TextButton *btn = new FbTk::TextButton(frame().label(), 366 FbTk::TextButton *btn = new FbTk::TextButton(frame().label(),
367 frame().theme().font(), 367 frame().theme().font(),
368 m_client->title()); 368 m_client->title());
@@ -385,6 +385,8 @@ void FluxboxWindow::init() {
385 385
386 frame().setEventHandler(*this); 386 frame().setEventHandler(*this);
387 387
388 frame().resize(m_client->width(), m_client->height());
389
388 m_last_focus_time.tv_sec = m_last_focus_time.tv_usec = 0; 390 m_last_focus_time.tv_sec = m_last_focus_time.tv_usec = 0;
389 391
390 // display connection 392 // display connection
@@ -510,6 +512,7 @@ void FluxboxWindow::init() {
510 if (!place_window) 512 if (!place_window)
511 moveResize(frame().x(), frame().y(), frame().width(), frame().height()); 513 moveResize(frame().x(), frame().y(), frame().width(), frame().height());
512 514
515
513 screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window); 516 screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
514 517
515 if (shaded) { // start shaded 518 if (shaded) { // start shaded
@@ -549,6 +552,8 @@ void FluxboxWindow::init() {
549 552
550 if (m_shaped) 553 if (m_shaped)
551 shape(); 554 shape();
555
556
552} 557}
553 558
554/// apply shape to this window 559/// apply shape to this window
@@ -777,6 +782,8 @@ bool FluxboxWindow::removeClient(WinClient &client) {
777 782
778 m_labelbuttons.erase(&client); 783 m_labelbuttons.erase(&client);
779 784
785 frame().reconfigure();
786
780#ifdef DEBUG 787#ifdef DEBUG
781 cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"] numClients = "<<numClients()<<endl; 788 cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"] numClients = "<<numClients()<<endl;
782#endif // DEBUG 789#endif // DEBUG
@@ -811,7 +818,7 @@ void FluxboxWindow::nextClient() {
811 m_client = *it; 818 m_client = *it;
812 m_client->raise(); 819 m_client->raise();
813 frame().setLabelButtonFocus(*m_labelbuttons[m_client]); 820 frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
814 setInputFocus(); 821 frame().setFocus(setInputFocus());
815} 822}
816 823
817void FluxboxWindow::prevClient() { 824void FluxboxWindow::prevClient() {
@@ -830,7 +837,7 @@ void FluxboxWindow::prevClient() {
830 837
831 m_client->raise(); 838 m_client->raise();
832 frame().setLabelButtonFocus(*m_labelbuttons[m_client]); 839 frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
833 setInputFocus(); 840 frame().setFocus(setInputFocus());
834} 841}
835 842
836 843
@@ -908,8 +915,6 @@ void FluxboxWindow::associateClientWindow() {
908 915
909 frame().setClientWindow(*m_client); 916 frame().setClientWindow(*m_client);
910 frame().resizeForClient(m_client->width(), m_client->height()); 917 frame().resizeForClient(m_client->width(), m_client->height());
911 // make sure the frame reconfigures
912 frame().reconfigure();
913} 918}
914 919
915 920
@@ -955,6 +960,8 @@ void FluxboxWindow::reconfigure() {
955 frame().setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval()); 960 frame().setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval());
956 frame().setUpdateDelayTime(Fluxbox::instance()->getUpdateDelayTime()); 961 frame().setUpdateDelayTime(Fluxbox::instance()->getUpdateDelayTime());
957 962
963 frame().reconfigure();
964
958 m_windowmenu.reconfigure(); 965 m_windowmenu.reconfigure();
959 966
960} 967}
@@ -1100,9 +1107,10 @@ void FluxboxWindow::moveResize(int new_x, int new_y,
1100 new_width = width(); 1107 new_width = width();
1101 new_height = height(); 1108 new_height = height();
1102 } 1109 }
1103 frame().moveResize(new_x, new_y, new_width, new_height);
1104 1110
1105 setFocusFlag(focused); 1111 setFocusFlag(focused);
1112 frame().moveResize(new_x, new_y, new_width, new_height);
1113
1106 shaded = false; 1114 shaded = false;
1107 send_event = true; 1115 send_event = true;
1108 } else { 1116 } else {
@@ -1258,13 +1266,8 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) {
1258 1266
1259 frame().show(); 1267 frame().show();
1260 1268
1261 if (was_iconic && screen().doFocusNew()) { 1269 if (was_iconic && screen().doFocusNew())
1262 setInputFocus(); 1270 setInputFocus();
1263 }
1264
1265 if (focused != frame().focused())
1266 frame().setFocus(focused);
1267
1268 1271
1269 if (reassoc && !m_client->transients.empty()) { 1272 if (reassoc && !m_client->transients.empty()) {
1270 // deiconify all transients 1273 // deiconify all transients
@@ -1281,7 +1284,9 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) {
1281 } 1284 }
1282 } 1285 }
1283 } 1286 }
1287
1284 oplock = false; 1288 oplock = false;
1289
1285 if (do_raise) 1290 if (do_raise)
1286 raise(); 1291 raise();
1287} 1292}
@@ -1646,7 +1651,10 @@ void FluxboxWindow::setFocusFlag(bool focus) {
1646 } 1651 }
1647 1652
1648 installColormap(focus); 1653 installColormap(focus);
1649 frame().setFocus(focus); 1654
1655 if (focus != frame().focused()) {
1656 frame().setFocus(focus);
1657 }
1650 1658
1651 if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus()) 1659 if ((screen().isSloppyFocus() || screen().isSemiSloppyFocus())
1652 && screen().doAutoRaise()) { 1660 && screen().doAutoRaise()) {
@@ -1712,8 +1720,7 @@ void FluxboxWindow::saveBlackboxAttribs() {
1712 PropModeReplace, 1720 PropModeReplace,
1713 (unsigned char *)&m_blackbox_attrib, 1721 (unsigned char *)&m_blackbox_attrib,
1714 PropBlackboxAttributesElements 1722 PropBlackboxAttributesElements
1715 ) 1723 ));
1716 );
1717} 1724}
1718 1725
1719/** 1726/**
@@ -2013,11 +2020,10 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) {
2013 2020
2014 setState(NormalState); 2021 setState(NormalState);
2015 2022
2016 if (client->isTransient() || screen().doFocusNew()) { 2023 if (client->isTransient() || screen().doFocusNew())
2017 setCurrentClient(*client, true); 2024 setCurrentClient(*client, true);
2018 }
2019 else 2025 else
2020 setFocusFlag(false); 2026 setFocusFlag(false);
2021 2027
2022 iconic = false; 2028 iconic = false;
2023 2029
@@ -2169,7 +2175,6 @@ void FluxboxWindow::exposeEvent(XExposeEvent &ee) {
2169 frame().exposeEvent(ee); 2175 frame().exposeEvent(ee);
2170} 2176}
2171 2177
2172
2173void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { 2178void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
2174 WinClient *client = findClient(cr.window); 2179 WinClient *client = findClient(cr.window);
2175 if (client == 0) 2180 if (client == 0)
@@ -2609,10 +2614,10 @@ void FluxboxWindow::applyDecorations(bool initial) {
2609 2614
2610 if (decorations.handle) { 2615 if (decorations.handle) {
2611 frame().showHandle(); 2616 frame().showHandle();
2612 frame().reconfigure(); // show handle requires reconfigure
2613 } else 2617 } else
2614 frame().hideHandle(); 2618 frame().hideHandle();
2615 2619
2620 frame().reconfigure();
2616} 2621}
2617 2622
2618void FluxboxWindow::toggleDecoration() { 2623void FluxboxWindow::toggleDecoration() {