diff options
author | fluxgen <fluxgen> | 2005-11-22 21:08:07 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2005-11-22 21:08:07 (GMT) |
commit | be1cbd46909e678bbd71f3a590e36c3077cb2960 (patch) | |
tree | ae75a34566620041c30747eb9925f70c3953f837 /src/FbTk/FbPixmap.cc | |
parent | b131f3a8afd3884763adcec17f8a9af3b80b8278 (diff) | |
download | fluxbox-be1cbd46909e678bbd71f3a590e36c3077cb2960.zip fluxbox-be1cbd46909e678bbd71f3a590e36c3077cb2960.tar.bz2 |
public setRootPixmap
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r-- | src/FbTk/FbPixmap.cc | 97 |
1 files changed, 52 insertions, 45 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc index ce28f0e..b8c2856 100644 --- a/src/FbTk/FbPixmap.cc +++ b/src/FbTk/FbPixmap.cc | |||
@@ -357,55 +357,62 @@ void FbPixmap::setRootPixmap(int screen_num, Pixmap pm) { | |||
357 | } | 357 | } |
358 | 358 | ||
359 | Pixmap FbPixmap::getRootPixmap(int screen_num) { | 359 | Pixmap FbPixmap::getRootPixmap(int screen_num) { |
360 | if (!FbTk::Transparent::haveRender()) | 360 | /* |
361 | return None; | 361 | if (!FbTk::Transparent::haveRender()) |
362 | 362 | return None; | |
363 | if (!m_root_pixmaps) { | 363 | */ |
364 | int numscreens = ScreenCount(display()); | 364 | |
365 | for (int i=0; i < numscreens; ++i) { | 365 | // check and see if if we have the pixmaps in cache |
366 | Atom real_type; | 366 | if (m_root_pixmaps) |
367 | int real_format; | 367 | return m_root_pixmaps[screen_num]; |
368 | unsigned long items_read, items_left; | 368 | |
369 | unsigned long *data; | 369 | // else setup pixmap cache |
370 | 370 | int numscreens = ScreenCount(display()); | |
371 | unsigned int prop = 0; | 371 | for (int i=0; i < numscreens; ++i) { |
372 | 372 | Atom real_type; | |
373 | static bool print_error = true; // print error_message only once | 373 | int real_format; |
374 | static const char* error_message = { "\n\n !!! WARNING WARNING WARNING WARNING !!!!!\n" | 374 | unsigned long items_read, items_left; |
375 | " if you experience problems with transparency:\n" | 375 | unsigned long *data; |
376 | " you are using a wallpapersetter that \n" | 376 | |
377 | " uses _XSETROOT_ID .. which we do not support.\n" | 377 | unsigned int prop = 0; |
378 | " consult 'fbsetbg -i' or try any other wallpapersetter\n" | 378 | |
379 | " that uses _XROOTPMAP_ID !\n" | 379 | static bool print_error = true; // print error_message only once |
380 | " !!! WARNING WARNING WARNING WARNING !!!!!!\n\n" | 380 | static const char* error_message = { |
381 | }; | 381 | "\n\n !!! WARNING WARNING WARNING WARNING !!!!!\n" |
382 | 382 | " if you experience problems with transparency:\n" | |
383 | Pixmap root_pm = None; | 383 | " you are using a wallpapersetter that \n" |
384 | for (prop = 0; root_prop_ids[prop]; prop++) { | 384 | " uses _XSETROOT_ID .. which we do not support.\n" |
385 | checkAtoms(); | 385 | " consult 'fbsetbg -i' or try any other wallpapersetter\n" |
386 | if (XGetWindowProperty(display(), | 386 | " that uses _XROOTPMAP_ID !\n" |
387 | RootWindow(display(), i), | 387 | " !!! WARNING WARNING WARNING WARNING !!!!!!\n\n" |
388 | root_prop_atoms[i], | 388 | }; |
389 | 0l, 1l, | 389 | |
390 | False, XA_PIXMAP, | 390 | Pixmap root_pm = None; |
391 | &real_type, &real_format, | 391 | for (prop = 0; root_prop_ids[prop]; prop++) { |
392 | &items_read, &items_left, | 392 | checkAtoms(); |
393 | (unsigned char **) &data) == Success) { | 393 | if (XGetWindowProperty(display(), |
394 | if (real_format == 32 && items_read == 1) { | 394 | RootWindow(display(), i), |
395 | if (print_error && strcmp(root_prop_ids[prop], "_XSETROOT_ID") == 0) { | 395 | root_prop_atoms[i], |
396 | cerr<<error_message; | 396 | 0l, 1l, |
397 | print_error = false; | 397 | False, XA_PIXMAP, |
398 | } else | 398 | &real_type, &real_format, |
399 | root_pm = (Pixmap) (*data); | 399 | &items_read, &items_left, |
400 | } | 400 | (unsigned char **) &data) == Success) { |
401 | XFree(data); | 401 | if (real_format == 32 && items_read == 1) { |
402 | if (root_pm != None) | 402 | if (print_error && strcmp(root_prop_ids[prop], "_XSETROOT_ID") == 0) { |
403 | break; | 403 | cerr<<error_message; |
404 | print_error = false; | ||
405 | } else | ||
406 | root_pm = (Pixmap) (*data); | ||
404 | } | 407 | } |
408 | XFree(data); | ||
409 | if (root_pm != None) | ||
410 | break; | ||
405 | } | 411 | } |
406 | setRootPixmap(i, root_pm); | ||
407 | } | 412 | } |
413 | setRootPixmap(i, root_pm); | ||
408 | } | 414 | } |
415 | |||
409 | return m_root_pixmaps[screen_num]; | 416 | return m_root_pixmaps[screen_num]; |
410 | } | 417 | } |
411 | 418 | ||