Permalink
Browse files

debug message in query_clients

  • Loading branch information...
1 parent 2913ab5 commit 4adc38099fdc77aad2fc0adf5c5a67f5ebddd9e3 @jedediah jedediah committed Sep 12, 2009
Showing with 10 additions and 6 deletions.
  1. +10 −6 xlib_ruby/ext/x11.c
View
@@ -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);

0 comments on commit 4adc380

Please sign in to comment.