aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-15 12:22:06 (GMT)
committerfluxgen <fluxgen>2003-04-15 12:22:06 (GMT)
commit77beb5472b35477ba1235cc7258071e4d4094e54 (patch)
treefa2451a56398cd4d09049807ff4e9fd60ab5046b /src
parent143be7a2d1858b5985ceffdd42a0e7fe7391d2d7 (diff)
downloadfluxbox_pavel-77beb5472b35477ba1235cc7258071e4d4094e54.zip
fluxbox_pavel-77beb5472b35477ba1235cc7258071e4d4094e54.tar.bz2
fixed client and icon count
Diffstat (limited to 'src')
-rw-r--r--src/Ewmh.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 92c6dbd..3d37a34 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Ewmh.cc,v 1.16 2003/04/15 00:14:24 fluxgen Exp $ 22// $Id: Ewmh.cc,v 1.17 2003/04/15 12:22:06 fluxgen Exp $
23 23
24#include "Ewmh.hh" 24#include "Ewmh.hh"
25 25
@@ -50,7 +50,8 @@ void Ewmh::initForScreen(BScreen &screen) {
50 50
51 51
52 Window wincheck = XCreateSimpleWindow(disp, 52 Window wincheck = XCreateSimpleWindow(disp,
53 screen.getRootWindow(), 0, 0, 5, 5, 0, 0, 0); 53 screen.getRootWindow(),
54 0, 0, 5, 5, 0, 0, 0);
54 55
55 if (wincheck != None) { 56 if (wincheck != None) {
56 m_windows.push_back(wincheck); 57 m_windows.push_back(wincheck);
@@ -142,13 +143,19 @@ void Ewmh::updateClientList(BScreen &screen) {
142 } 143 }
143 144
144 } 145 }
145 //int num = getCurrentWorkspace()->getWindowList().size(); 146 // and count icons
147 BScreen::Icons::const_iterator icon_it = screen.getIconList().begin();
148 BScreen::Icons::const_iterator icon_it_end = screen.getIconList().end();
149 for (; icon_it != icon_it_end; ++icon_it) {
150 num += (*icon_it)->numClients();
151 }
146 152
147 Window *wl = new (nothrow) Window[num]; 153 Window *wl = new (nothrow) Window[num];
148 if (wl == 0) { 154 if (wl == 0) {
149 cerr<<"Fatal: Out of memory, can't allocate for Ewmh client list"<<endl; 155 cerr<<"Fatal: Out of memory, can't allocate for Ewmh client list"<<endl;
150 return; 156 return;
151 } 157 }
158
152 //start the iterator from begining 159 //start the iterator from begining
153 workspace_it = screen.getWorkspacesList().begin(); 160 workspace_it = screen.getWorkspacesList().begin();
154 int win=0; 161 int win=0;
@@ -175,10 +182,12 @@ void Ewmh::updateClientList(BScreen &screen) {
175 } 182 }
176 183
177 // plus iconified windows 184 // plus iconified windows
178 BScreen::Icons::const_iterator it = screen.getIconList().begin(); 185 icon_it = screen.getIconList().begin();
179 BScreen::Icons::const_iterator it_end = screen.getIconList().end(); 186 for (; icon_it != icon_it_end; ++icon_it) {
180 for (; it != it_end; ++it) { 187 FluxboxWindow::ClientList::iterator client_it = (*icon_it)->clientList().begin();
181 wl[win++] = (*it)->getClientWindow(); 188 FluxboxWindow::ClientList::iterator client_it_end = (*icon_it)->clientList().end();
189 for (; client_it != client_it_end; ++client_it)
190 wl[win++] = (*client_it)->window();
182 } 191 }
183 192
184 //number of windows to show in client list 193 //number of windows to show in client list