aboutsummaryrefslogtreecommitdiff
path: root/src/ToolbarHandler.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-06-26 12:22:43 (GMT)
committerrathnor <rathnor>2003-06-26 12:22:43 (GMT)
commit4993e2f36331299aba6a42df2896e49d4c98b111 (patch)
treee130579b68dbf4244913e676060d0f6fd624140b /src/ToolbarHandler.cc
parenta1eb047c00e96295e482564311db9075d05ce034 (diff)
downloadfluxbox_pavel-4993e2f36331299aba6a42df2896e49d4c98b111.zip
fluxbox_pavel-4993e2f36331299aba6a42df2896e49d4c98b111.tar.bz2
speedups for having lots of stuck windows
Diffstat (limited to 'src/ToolbarHandler.cc')
-rw-r--r--src/ToolbarHandler.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc
index d7cf8f0..317890a 100644
--- a/src/ToolbarHandler.cc
+++ b/src/ToolbarHandler.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ToolbarHandler.cc,v 1.17 2003/06/24 16:27:18 fluxgen Exp $ 23// $Id: ToolbarHandler.cc,v 1.18 2003/06/26 12:22:42 rathnor Exp $
24 24
25/** 25/**
26 * The ToolbarHandler class acts as a rough interface to the toolbar. 26 * The ToolbarHandler class acts as a rough interface to the toolbar.
@@ -199,6 +199,10 @@ void ToolbarHandler::setMode(ToolbarMode newmode, bool initialise) {
199void ToolbarHandler::initForScreen(BScreen &screen) { 199void ToolbarHandler::initForScreen(BScreen &screen) {
200 if (&m_screen != &screen) 200 if (&m_screen != &screen)
201 return; 201 return;
202
203 if (m_toolbar.get() != 0)
204 m_toolbar->disableUpdates();
205
202 switch (mode()) { 206 switch (mode()) {
203 case OFF: 207 case OFF:
204 break; 208 break;
@@ -212,6 +216,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
212 Workspace::Windows::iterator wit = wins.begin(); 216 Workspace::Windows::iterator wit = wins.begin();
213 Workspace::Windows::iterator wit_end = wins.end(); 217 Workspace::Windows::iterator wit_end = wins.end();
214 for (; wit != wit_end; ++wit) { 218 for (; wit != wit_end; ++wit) {
219 if (!m_toolbar->containsIcon(**wit))
215 m_toolbar->addIcon(*wit); 220 m_toolbar->addIcon(*wit);
216/* 221/*
217 FluxboxWindow::ClientList::iterator cit = (*wit)->clientList().begin(); 222 FluxboxWindow::ClientList::iterator cit = (*wit)->clientList().begin();
@@ -238,7 +243,8 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
238 Workspace::Windows::iterator wit = wins.begin(); 243 Workspace::Windows::iterator wit = wins.begin();
239 Workspace::Windows::iterator wit_end = wins.end(); 244 Workspace::Windows::iterator wit_end = wins.end();
240 for (; wit != wit_end; ++wit) { 245 for (; wit != wit_end; ++wit) {
241 m_toolbar->addIcon(*wit); 246 if (!m_toolbar->containsIcon(**wit))
247 m_toolbar->addIcon(*wit);
242 } 248 }
243 } 249 }
244 // fall through and add icons for this workspace 250 // fall through and add icons for this workspace
@@ -255,6 +261,10 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
255 } 261 }
256 break; 262 break;
257 } 263 }
264
265 if (m_toolbar.get() != 0)
266 m_toolbar->enableUpdates();
267
258} 268}
259 269
260void ToolbarHandler::setupWindow(FluxboxWindow &win) { 270void ToolbarHandler::setupWindow(FluxboxWindow &win) {
@@ -305,7 +315,7 @@ void ToolbarHandler::updateWindowClose(FluxboxWindow &win) {
305 } 315 }
306 break; 316 break;
307 case WORKSPACE: 317 case WORKSPACE:
308 if (win.workspaceNumber() == m_current_workspace) 318 if (win.isStuck() || win.workspaceNumber() == m_current_workspace)
309 m_toolbar->delIcon(&win); 319 m_toolbar->delIcon(&win);
310 break; 320 break;
311 case ALLWINDOWS: 321 case ALLWINDOWS:
@@ -364,7 +374,8 @@ void ToolbarHandler::updateWorkspace(FluxboxWindow &win) {
364 m_toolbar->addIcon(&win); 374 m_toolbar->addIcon(&win);
365 } else { 375 } else {
366 // relies on the fact that this runs but does nothing if window isn't contained. 376 // relies on the fact that this runs but does nothing if window isn't contained.
367 m_toolbar->delIcon(&win); 377 if (!win.isStuck())
378 m_toolbar->delIcon(&win);
368 } 379 }
369} 380}
370 381
@@ -375,8 +386,10 @@ void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) {
375 // otherwise ignore it 386 // otherwise ignore it
376 if (mode() != WORKSPACE && mode() != WORKSPACEICONS) 387 if (mode() != WORKSPACE && mode() != WORKSPACEICONS)
377 return; 388 return;
378 m_toolbar->delAllIcons(); 389 m_toolbar->disableUpdates();
390 m_toolbar->delAllIcons(true);
379 initForScreen(m_screen); 391 initForScreen(m_screen);
392 m_toolbar->enableUpdates();
380 m_toolbar->redrawWorkspaceLabel(true); 393 m_toolbar->redrawWorkspaceLabel(true);
381} 394}
382 395