Skip to content

Commit

Permalink
debug message in query_clients
Browse files Browse the repository at this point in the history
  • Loading branch information
jedediah committed Sep 12, 2009
1 parent 2913ab5 commit 4adc380
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions xlib_ruby/ext/x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,20 @@ Client* query_clients(WM* winman) {

wins = NULL;
if (XQueryTree(winman->dpy, winman->root, &d1, &d2, &wins, &num)) {
winman->clients_num = 0;
c = (Client*)calloc(num, sizeof(Client));
for (i = 0; i < num; i++) {
if (XGetWindowAttributes(winman->dpy, wins[i], &wa) &&
!wa.override_redirect &&
fprintf(stderr,"Managing %i windows...\n",num);
winman->clients_num = 0;
c = (Client*)calloc(num, sizeof(Client));
for (i = 0; i < num; i++) {
if (XGetWindowAttributes(winman->dpy, wins[i], &wa)) {
if (!wa.override_redirect &&
(wa.map_state == IsViewable || getstate(winman,wins[i]) == IconicState)) {
winman->clients_num += 1;
manage(winman, wins[i], &wa, &c[i]);
}
} else {
fprintf(stderr,"Ignoring %x (map_state=%i override_redirect=%i)\n",(int)wins[i],(int)wa.map_state,(int)wa.override_redirect);
}
}
}
}
if(wins)
XFree(wins);
Expand Down

0 comments on commit 4adc380

Please sign in to comment.