diff options
author | markt <markt> | 2006-07-29 06:28:58 (GMT) |
---|---|---|
committer | markt <markt> | 2006-07-29 06:28:58 (GMT) |
commit | f66d91cf2281e9a7aec64b7c903c1ba91898324f (patch) | |
tree | f58b64071a2b84cc700a06fbd72529cd99cda3a1 /src/Ewmh.cc | |
parent | 98fba4fd1a50672a918dccd5c8492556f392762f (diff) | |
download | fluxbox_pavel-f66d91cf2281e9a7aec64b7c903c1ba91898324f.zip fluxbox_pavel-f66d91cf2281e9a7aec64b7c903c1ba91898324f.tar.bz2 |
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r-- | src/Ewmh.cc | 63 |
1 files changed, 8 insertions, 55 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index b6c765e..51f7fa8 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "WinClientUtil.hh" | 31 | #include "WinClientUtil.hh" |
32 | #include "fluxbox.hh" | 32 | #include "fluxbox.hh" |
33 | #include "FbWinFrameTheme.hh" | 33 | #include "FbWinFrameTheme.hh" |
34 | #include "FocusControl.hh" | ||
34 | 35 | ||
35 | #include "FbTk/App.hh" | 36 | #include "FbTk/App.hh" |
36 | #include "FbTk/FbWindow.hh" | 37 | #include "FbTk/FbWindow.hh" |
@@ -366,29 +367,10 @@ void Ewmh::updateClientClose(WinClient &winclient){ | |||
366 | } | 367 | } |
367 | 368 | ||
368 | void Ewmh::updateClientList(BScreen &screen) { | 369 | void Ewmh::updateClientList(BScreen &screen) { |
369 | size_t num=0; | ||
370 | |||
371 | BScreen::Workspaces::const_iterator workspace_it = | ||
372 | screen.getWorkspacesList().begin(); | ||
373 | const BScreen::Workspaces::const_iterator workspace_it_end = | ||
374 | screen.getWorkspacesList().end(); | ||
375 | for (; workspace_it != workspace_it_end; ++workspace_it) { | ||
376 | Workspace::Windows::iterator win_it = | ||
377 | (*workspace_it)->windowList().begin(); | ||
378 | Workspace::Windows::iterator win_it_end = | ||
379 | (*workspace_it)->windowList().end(); | ||
380 | for (; win_it != win_it_end; ++win_it) { | ||
381 | num += (*win_it)->numClients(); | ||
382 | } | ||
383 | 370 | ||
384 | } | 371 | std::list<WinClient *> creation_order_list = screen.focusControl().creationOrderList(); |
385 | // and count icons | ||
386 | BScreen::Icons::const_iterator icon_it = screen.iconList().begin(); | ||
387 | BScreen::Icons::const_iterator icon_it_end = screen.iconList().end(); | ||
388 | for (; icon_it != icon_it_end; ++icon_it) { | ||
389 | num += (*icon_it)->numClients(); | ||
390 | } | ||
391 | 372 | ||
373 | size_t num = creation_order_list.size(); | ||
392 | Window *wl = FB_new_nothrow Window[num]; | 374 | Window *wl = FB_new_nothrow Window[num]; |
393 | if (wl == 0) { | 375 | if (wl == 0) { |
394 | _FB_USES_NLS; | 376 | _FB_USES_NLS; |
@@ -397,39 +379,12 @@ void Ewmh::updateClientList(BScreen &screen) { | |||
397 | return; | 379 | return; |
398 | } | 380 | } |
399 | 381 | ||
400 | //start the iterator from begining | ||
401 | workspace_it = screen.getWorkspacesList().begin(); | ||
402 | int win=0; | 382 | int win=0; |
403 | for (; workspace_it != workspace_it_end; ++workspace_it) { | 383 | std::list<WinClient *>::iterator client_it = creation_order_list.begin(); |
404 | 384 | std::list<WinClient *>::iterator client_it_end = creation_order_list.end(); | |
405 | // Fill in array of window ID's | 385 | for (; client_it != client_it_end; ++client_it) |
406 | Workspace::Windows::const_iterator it = | 386 | wl[win++] = (*client_it)->window(); |
407 | (*workspace_it)->windowList().begin(); | ||
408 | Workspace::Windows::const_iterator it_end = | ||
409 | (*workspace_it)->windowList().end(); | ||
410 | for (; it != it_end; ++it) { | ||
411 | if ((*it)->numClients() == 1) { | ||
412 | wl[win++] = (*it)->clientWindow(); | ||
413 | } else { | ||
414 | // add every client in fluxboxwindow to list window list | ||
415 | std::list<WinClient *>::iterator client_it = | ||
416 | (*it)->clientList().begin(); | ||
417 | std::list<WinClient *>::iterator client_it_end = | ||
418 | (*it)->clientList().end(); | ||
419 | for (; client_it != client_it_end; ++client_it) | ||
420 | wl[win++] = (*client_it)->window(); | ||
421 | } | ||
422 | } | ||
423 | } | ||
424 | 387 | ||
425 | // plus iconified windows | ||
426 | icon_it = screen.iconList().begin(); | ||
427 | for (; icon_it != icon_it_end; ++icon_it) { | ||
428 | FluxboxWindow::ClientList::iterator client_it = (*icon_it)->clientList().begin(); | ||
429 | FluxboxWindow::ClientList::iterator client_it_end = (*icon_it)->clientList().end(); | ||
430 | for (; client_it != client_it_end; ++client_it) | ||
431 | wl[win++] = (*client_it)->window(); | ||
432 | } | ||
433 | //number of windows to show in client list | 388 | //number of windows to show in client list |
434 | num = win; | 389 | num = win; |
435 | 390 | ||
@@ -703,9 +658,7 @@ void Ewmh::updateHints(FluxboxWindow &win) { | |||
703 | } | 658 | } |
704 | 659 | ||
705 | void Ewmh::updateWorkspace(FluxboxWindow &win) { | 660 | void Ewmh::updateWorkspace(FluxboxWindow &win) { |
706 | long workspace = win.isInitialized() ? | 661 | long workspace = win.workspaceNumber(); |
707 | win.workspaceNumber() : | ||
708 | win.screen().currentWorkspaceID(); | ||
709 | 662 | ||
710 | if (win.isStuck()) | 663 | if (win.isStuck()) |
711 | workspace = -1; // appear on all desktops/workspaces | 664 | workspace = -1; // appear on all desktops/workspaces |