… | |
… | |
231 | if (n < MAXLEN_GEOM) |
231 | if (n < MAXLEN_GEOM) |
232 | { |
232 | { |
233 | strncpy (str, geom, n); |
233 | strncpy (str, geom, n); |
234 | str[n] = '\0'; |
234 | str[n] = '\0'; |
235 | |
235 | |
236 | if (strcmp(str, "auto") == 0) |
236 | if (strcmp(str, "auto") == 0) |
237 | { |
237 | { |
238 | if (!bgpixmap->auto_resize) |
238 | if (!bgpixmap->auto_resize) |
239 | changed++; |
239 | changed++; |
240 | bgpixmap->auto_resize = True ; |
240 | bgpixmap->auto_resize = True ; |
241 | w = szHint.width ; |
241 | w = szHint.width ; |
242 | h = szHint.height ; |
242 | h = szHint.height ; |
243 | flags = WidthValue|HeightValue ; |
243 | flags = WidthValue|HeightValue ; |
244 | } |
244 | } |
245 | else |
245 | else |
246 | { |
246 | { |
247 | bgpixmap->auto_resize = False ; |
247 | bgpixmap->auto_resize = False ; |
248 | flags = XParseGeometry (str, &x, &y, &w, &h); |
248 | flags = XParseGeometry (str, &x, &y, &w, &h); |
249 | } |
249 | } |
250 | |
250 | |
251 | if (!flags) |
251 | if (!flags) |
252 | { |
252 | { |
… | |
… | |
357 | unsigned int w = bgPixmap.w, h = bgPixmap.h, |
357 | unsigned int w = bgPixmap.w, h = bgPixmap.h, |
358 | x = bgPixmap.x, y = bgPixmap.y; |
358 | x = bgPixmap.x, y = bgPixmap.y; |
359 | unsigned int xpmh = xpmAttr.height, |
359 | unsigned int xpmh = xpmAttr.height, |
360 | xpmw = xpmAttr.width; |
360 | xpmw = xpmAttr.width; |
361 | |
361 | |
362 | if (bgPixmap.auto_resize) |
362 | if (bgPixmap.auto_resize) |
363 | { |
363 | { |
364 | w = szHint.width ; |
364 | w = szHint.width ; |
365 | h = szHint.height ; |
365 | h = szHint.height ; |
366 | } |
366 | } |
367 | /* |
367 | /* |
368 | * don't zoom pixmap too much nor expand really small pixmaps |
368 | * don't zoom pixmap too much nor expand really small pixmaps |
369 | */ |
369 | */ |
370 | if (w > 32767 || h > 32767) |
370 | if (w > 32767 || h > 32767) |
371 | w = 1; |
371 | w = 1; |
… | |
… | |
389 | if (!option(Opt_transparent) || !am_transparent) |
389 | if (!option(Opt_transparent) || !am_transparent) |
390 | /* will do that in check_our_parents otherwise */ |
390 | /* will do that in check_our_parents otherwise */ |
391 | #endif |
391 | #endif |
392 | { |
392 | { |
393 | ASImage *scaled_im = scale_asimage (asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT); |
393 | ASImage *scaled_im = scale_asimage (asv, original_asim, w, h, ASA_XImage, 0, ASIMAGE_QUALITY_DEFAULT); |
394 | if (scaled_im) |
394 | if (scaled_im) |
395 | { |
395 | { |
396 | pixmap = asimage2pixmap(asv, display->root, scaled_im, gc, True); |
396 | pixmap = asimage2pixmap(asv, display->root, scaled_im, gc, True); |
397 | destroy_asimage (&scaled_im); |
397 | destroy_asimage (&scaled_im); |
398 | } |
398 | } |
399 | } |
399 | } |
… | |
… | |
476 | * we already have the required attributes |
476 | * we already have the required attributes |
477 | */ |
477 | */ |
478 | /* XGetWindowAttributes (dpy, vt, &attr); */ |
478 | /* XGetWindowAttributes (dpy, vt, &attr); */ |
479 | |
479 | |
480 | #ifdef HAVE_AFTERIMAGE |
480 | #ifdef HAVE_AFTERIMAGE |
481 | if (asimman == NULL) |
481 | if (asimman == NULL) |
482 | asimman = create_generic_imageman(rs[Rs_path]); |
482 | asimman = create_generic_imageman(rs[Rs_path]); |
483 | if ((f = strchr (file, ';')) == NULL) |
483 | if ((f = strchr (file, ';')) == NULL) |
484 | original_asim = get_asimage( asimman, file, 0xFFFFFFFF, 100 ); |
484 | original_asim = get_asimage( asimman, file, 0xFFFFFFFF, 100 ); |
485 | else |
485 | else |
486 | { |
486 | { |
487 | size_t len = f - file; |
487 | size_t len = f - file; |
488 | f = (char *)malloc (len + 1); |
488 | f = (char *)malloc (len + 1); |
489 | strncpy (f, file, len); |
489 | strncpy (f, file, len); |
490 | f[len] = '\0'; |
490 | f[len] = '\0'; |
491 | original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 ); |
491 | original_asim = get_asimage( asimman, f, 0xFFFFFFFF, 100 ); |
492 | free( f ); |
492 | free( f ); |
493 | } |
493 | } |
494 | if (original_asim) |
494 | if (original_asim) |
495 | { |
495 | { |
496 | bgPixmap.pixmap = asimage2pixmap (asv, display->root, original_asim, NULL, True); |
496 | bgPixmap.pixmap = asimage2pixmap (asv, display->root, original_asim, NULL, True); |
497 | xpmAttr.width = original_asim->width ; |
497 | xpmAttr.width = original_asim->width ; |
498 | xpmAttr.height = original_asim->height ; |
498 | xpmAttr.height = original_asim->height ; |
499 | } |
499 | } |
500 | #else /* HAVE_AFTERIMAGE */ |
500 | #else /* HAVE_AFTERIMAGE */ |
501 | xpmAttr.closeness = 30000; |
501 | xpmAttr.closeness = 30000; |
502 | xpmAttr.colormap = cmap; |
502 | xpmAttr.colormap = cmap; |
503 | xpmAttr.visual = visual; |
503 | xpmAttr.visual = visual; |
… | |
… | |
815 | |
815 | |
816 | XTranslateCoordinates (dpy, parent[0], display->root, |
816 | XTranslateCoordinates (dpy, parent[0], display->root, |
817 | 0, 0, &sx, &sy, &cr); |
817 | 0, 0, &sx, &sy, &cr); |
818 | |
818 | |
819 | /* check if we are outside of the visible part of the virtual screen : */ |
819 | /* check if we are outside of the visible part of the virtual screen : */ |
820 | if( sx + (int)szHint.width <= 0 || sy + (int)szHint.height <= 0 |
820 | if( sx + (int)szHint.width <= 0 || sy + (int)szHint.height <= 0 |
821 | || sx >= wrootattr.width || sy >= wrootattr.height ) |
821 | || sx >= wrootattr.width || sy >= wrootattr.height ) |
822 | return /* 0 */ ; |
822 | return /* 0 */ ; |
823 | /* |
823 | /* |
824 | * Make the frame window set by the window manager have |
824 | * Make the frame window set by the window manager have |
825 | * the root background. Some window managers put multiple nested frame |
825 | * the root background. Some window managers put multiple nested frame |
826 | * windows for each client, so we have to take care about that. |
826 | * windows for each client, so we have to take care about that. |
… | |
… | |
865 | Pixmap tmp_pmap = None; |
865 | Pixmap tmp_pmap = None; |
866 | ShadingInfo shade; |
866 | ShadingInfo shade; |
867 | ARGB32 tint; |
867 | ARGB32 tint; |
868 | |
868 | |
869 | if (get_dpy_drawable_size (dpy, rootpixmap, &pmap_w, &pmap_h)) |
869 | if (get_dpy_drawable_size (dpy, rootpixmap, &pmap_w, &pmap_h)) |
870 | { |
870 | { |
871 | int root_x = 0, root_y = 0; |
871 | int root_x = 0, root_y = 0; |
872 | |
872 | |
873 | shade.shading = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
873 | shade.shading = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
874 | if (ISSET_PIXCOLOR (Color_tint)) |
874 | if (ISSET_PIXCOLOR (Color_tint)) |
875 | { |
875 | { |
876 | rgba c; |
876 | rgba c; |
877 | pix_colors_focused [Color_tint].get (c); |
877 | pix_colors_focused [Color_tint].get (c); |
878 | shade.tintColor.red = c.r; |
878 | shade.tintColor.red = c.r; |
879 | shade.tintColor.green = c.g; |
879 | shade.tintColor.green = c.g; |
880 | shade.tintColor.blue = c.b; |
880 | shade.tintColor.blue = c.b; |
881 | } |
881 | } |
882 | else |
882 | else |
883 | shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF; |
883 | shade.tintColor.red = shade.tintColor.green = shade.tintColor.blue = 0xFFFF; |
… | |
… | |
898 | else \ |
898 | else \ |
899 | { /* small background - need the whole of it for successfull tiling :*/ \ |
899 | { /* small background - need the whole of it for successfull tiling :*/ \ |
900 | back_##xy = 0; \ |
900 | back_##xy = 0; \ |
901 | back_##wh = pmap_##wh; \ |
901 | back_##wh = pmap_##wh; \ |
902 | }}while(0) |
902 | }}while(0) |
903 | |
903 | |
904 | MAKE_ROOTPMAP_GEOM(x,w,width); |
904 | MAKE_ROOTPMAP_GEOM(x,w,width); |
905 | MAKE_ROOTPMAP_GEOM(y,h,height); |
905 | MAKE_ROOTPMAP_GEOM(y,h,height); |
906 | |
906 | |
907 | layers[0].im = pixmap2asimage (asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100); |
907 | layers[0].im = pixmap2asimage (asv, rootpixmap, back_x, back_y, back_w, back_h, AllPlanes, ASA_ASImage, 100); |
908 | layers[0].clip_x = (back_w == pmap_w)?root_x:0; |
908 | layers[0].clip_x = (back_w == pmap_w)?root_x:0; |
… | |
… | |
1053 | ShadeXImage (this, image, shade, c.r, c.g, c.b); |
1053 | ShadeXImage (this, image, shade, c.r, c.g, c.b); |
1054 | XPutImage (dpy, pixmap, gc, image, 0, 0, 0, 0, image->width, image->height); |
1054 | XPutImage (dpy, pixmap, gc, image, 0, 0, 0, 0, image->width, image->height); |
1055 | XDestroyImage (image); |
1055 | XDestroyImage (image); |
1056 | success = True; |
1056 | success = True; |
1057 | } |
1057 | } |
1058 | #endif |
1058 | #endif |
1059 | } |
1059 | } |
1060 | allowedxerror = 0; |
1060 | allowedxerror = 0; |
1061 | } |
1061 | } |
1062 | #endif /* HAVE_AFTERIMAGE */ |
1062 | #endif /* HAVE_AFTERIMAGE */ |
1063 | if (gc != NULL) |
1063 | if (gc != NULL) |
1064 | XFreeGC (dpy, gc); |
1064 | XFreeGC (dpy, gc); |
1065 | |
1065 | |
1066 | if (!success) |
1066 | if (!success) |
1067 | { |
1067 | { |
1068 | if (am_transparent && am_pixmap_trans) |
1068 | if (am_transparent && am_pixmap_trans) |