1 | /* |
1 | /* |
2 | * Copyright 2001 by Marco d'Itri <md@linux.it> |
2 | * Copyright 2001 by Marco d'Itri <md@linux.it> |
3 | * Copyright 2000,2001,2002,2003,2004 |
3 | * Copyright 2000,2001,2002,2003,2004 |
4 | * Marc Lehmann <pcg@goof.com>, |
4 | * Marc Lehmann <pcg@goof.com>, |
|
|
5 | * Chris Moore <chris.moore@mail.com>, |
5 | * and many others, see README |
6 | * and many others, see README |
6 | * |
7 | * |
7 | * Original version by Mike Baker. |
8 | * Original version by Mike Baker. |
8 | * |
9 | * |
9 | * This program is free software; you can redistribute it and/or modify |
10 | * This program is free software; you can redistribute it and/or modify |
… | |
… | |
234 | if (SWM_VROOT != None) |
235 | if (SWM_VROOT != None) |
235 | { |
236 | { |
236 | Window unused, *windows; |
237 | Window unused, *windows; |
237 | unsigned int count; |
238 | unsigned int count; |
238 | |
239 | |
239 | if (XQueryTree (display, real_root_window, &unused, &unused, &windows, |
240 | if (XQueryTree (display, real_root_window, &unused, &unused, &windows, &count)) |
240 | &count)) |
|
|
241 | { |
241 | { |
242 | int i; |
242 | int i; |
243 | |
243 | |
244 | for (i = 0; i < count; i++) |
244 | for (i = 0; i < count; i++) |
245 | { |
245 | { |
… | |
… | |
255 | { |
255 | { |
256 | if (type != None) |
256 | if (type != None) |
257 | { |
257 | { |
258 | if (type == XA_WINDOW) |
258 | if (type == XA_WINDOW) |
259 | { |
259 | { |
|
|
260 | root = *(Window *)virtual_root_window; |
260 | XFree (windows); |
261 | XFree (windows); |
261 | return (Window) virtual_root_window; |
262 | XFree (virtual_root_window); |
|
|
263 | return root; |
262 | } |
264 | } |
263 | else |
265 | else |
264 | fprintf (stderr, |
|
|
265 | "__SWM_VROOT property type mismatch"); |
266 | fprintf (stderr, "__SWM_VROOT property type mismatch"); |
266 | } |
267 | } |
267 | } |
268 | } |
268 | else |
269 | else |
269 | fprintf (stderr, |
270 | fprintf (stderr, |
270 | "failed to get __SWM_VROOT property on window 0x%lx", |
271 | "failed to get __SWM_VROOT property on window 0x%lx", |