… | |
… | |
441 | { |
441 | { |
442 | flags = new_flags; |
442 | flags = new_flags; |
443 | changed++; |
443 | changed++; |
444 | } |
444 | } |
445 | |
445 | |
446 | //fprintf (stderr, "flags = %lX, scale = %ux%u, align=%+d%+d\n", |
446 | //fprintf (stderr, "flags = %lX, scale = %ux%u, align=%+d%+d\n", |
447 | // flags, h_scale, v_scale, h_align, v_align); |
447 | // flags, h_scale, v_scale, h_align, v_align); |
448 | return (changed > 0); |
448 | return (changed > 0); |
449 | } |
449 | } |
450 | |
450 | |
451 | # ifdef HAVE_AFTERIMAGE |
451 | # ifdef HAVE_AFTERIMAGE |
452 | bool |
452 | bool |
… | |
… | |
480 | } |
480 | } |
481 | |
481 | |
482 | if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL) |
482 | if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL) |
483 | { |
483 | { |
484 | ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF, |
484 | ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF, |
485 | (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage, |
485 | (original_asim == NULL || tint == TINT_LEAVE_SAME) ? ASA_XImage : ASA_ASImage, |
486 | 100, ASIMAGE_QUALITY_DEFAULT); |
486 | 100, ASIMAGE_QUALITY_DEFAULT); |
487 | if (tmp) |
487 | if (tmp) |
488 | { |
488 | { |
489 | destroy_asimage (&background); |
489 | destroy_asimage (&background); |
490 | background = tmp; |
490 | background = tmp; |
… | |
… | |
508 | |
508 | |
509 | if (original_asim) |
509 | if (original_asim) |
510 | { |
510 | { |
511 | if (h_align == rootAlign || v_align == rootAlign) |
511 | if (h_align == rootAlign || v_align == rootAlign) |
512 | { |
512 | { |
513 | target->get_window_origin(x, y); |
513 | target->get_window_origin (x, y); |
514 | x = -x; |
514 | x = -x; |
515 | y = -y; |
515 | y = -y; |
516 | } |
516 | } |
517 | |
517 | |
518 | if (h_align != rootAlign) |
518 | if (h_align != rootAlign) |
… | |
… | |
670 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
670 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
671 | pmap_width = new_pmap_width; |
671 | pmap_width = new_pmap_width; |
672 | pmap_height = new_pmap_height; |
672 | pmap_height = new_pmap_height; |
673 | pmap_depth = target->depth; |
673 | pmap_depth = target->depth; |
674 | } |
674 | } |
675 | /* fill with background color ( if result's not completely overlapping it)*/ |
675 | /* fill with background color (if result's not completely overlapping it) */ |
676 | gcv.foreground = target->pix_colors[Color_bg]; |
676 | gcv.foreground = target->pix_colors[Color_bg]; |
677 | gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); |
677 | gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); |
678 | |
678 | |
679 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
679 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
680 | int dst_width = result->width, dst_height = result->height; |
680 | int dst_width = result->width, dst_height = result->height; |
… | |
… | |
804 | flags |= bgPixmap_t::tintNeeded; |
804 | flags |= bgPixmap_t::tintNeeded; |
805 | else if (tint) |
805 | else if (tint) |
806 | { |
806 | { |
807 | if ((c.r > 0x000700 || c.g > 0x000700 || c.b > 0x000700) |
807 | if ((c.r > 0x000700 || c.g > 0x000700 || c.b > 0x000700) |
808 | && (c.r < 0x00f700 || c.g < 0x00f700 || c.b < 0x00f700)) |
808 | && (c.r < 0x00f700 || c.g < 0x00f700 || c.b < 0x00f700)) |
809 | { |
809 | { |
810 | flags |= bgPixmap_t::tintNeeded; |
810 | flags |= bgPixmap_t::tintNeeded; |
811 | } |
811 | } |
812 | } |
812 | } |
813 | |
813 | |
814 | if (flags & bgPixmap_t::tintNeeded) |
814 | if (flags & bgPixmap_t::tintNeeded) |
815 | { |
815 | { |
816 | if (flags & bgPixmap_t::tintWholesome) |
816 | if (flags & bgPixmap_t::tintWholesome) |
… | |
… | |
845 | { |
845 | { |
846 | unsigned long new_flags = compute_tint_shade_flags (NULL, shade); |
846 | unsigned long new_flags = compute_tint_shade_flags (NULL, shade); |
847 | |
847 | |
848 | if (new_flags != (flags & tintFlags)) |
848 | if (new_flags != (flags & tintFlags)) |
849 | { |
849 | { |
850 | flags = (flags&~tintFlags)|new_flags; |
850 | flags = (flags&~tintFlags)|new_flags; |
851 | return true; |
851 | return true; |
852 | } |
852 | } |
853 | |
853 | |
854 | return false; |
854 | return false; |
855 | } |
855 | } |
856 | |
856 | |
… | |
… | |
941 | |
941 | |
942 | attr.background_pixmap = ParentRelative; |
942 | attr.background_pixmap = ParentRelative; |
943 | attr.backing_store = Always; |
943 | attr.backing_store = Always; |
944 | attr.event_mask = ExposureMask; |
944 | attr.event_mask = ExposureMask; |
945 | attr.override_redirect = True; |
945 | attr.override_redirect = True; |
946 | src = XCreateWindow (dpy, root, sx, sy, window_width, window_height, 0, |
946 | src = XCreateWindow (dpy, root, sx, sy, window_width, window_height, 0, |
947 | CopyFromParent, CopyFromParent, CopyFromParent, |
947 | CopyFromParent, CopyFromParent, CopyFromParent, |
948 | CWBackPixmap|CWBackingStore|CWOverrideRedirect|CWEventMask, |
948 | CWBackPixmap|CWBackingStore|CWOverrideRedirect|CWEventMask, |
949 | &attr); |
949 | &attr); |
950 | |
950 | |
951 | if (src != None) |
951 | if (src != None) |
… | |
… | |
975 | XDestroyWindow (dpy, src); |
975 | XDestroyWindow (dpy, src); |
976 | XUngrabServer (dpy); |
976 | XUngrabServer (dpy); |
977 | //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count); |
977 | //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count); |
978 | } |
978 | } |
979 | |
979 | |
980 | if (!success) |
980 | if (!success) |
981 | { |
981 | { |
982 | XFreePixmap (dpy, tiled_root_pmap); |
982 | XFreePixmap (dpy, tiled_root_pmap); |
983 | tiled_root_pmap = None; |
983 | tiled_root_pmap = None; |
984 | } |
984 | } |
985 | else |
985 | else |
986 | result |= transpPmapTiled; |
986 | result |= transpPmapTiled; |
987 | } |
987 | } |
988 | else |
988 | else |
989 | { |
989 | { |
990 | /* straightforward pixmap copy */ |
990 | /* straightforward pixmap copy */ |
991 | gcv.tile = root_pixmap; |
991 | gcv.tile = root_pixmap; |
… | |
… | |
1108 | # if DO_TIMING_TEST |
1108 | # if DO_TIMING_TEST |
1109 | XSync (dpy, False); |
1109 | XSync (dpy, False); |
1110 | # endif |
1110 | # endif |
1111 | # endif |
1111 | # endif |
1112 | } |
1112 | } |
1113 | } |
1113 | } |
1114 | } /* server side rendering completed */ |
1114 | } /* server side rendering completed */ |
1115 | |
1115 | |
1116 | if (pixmap) |
1116 | if (pixmap) |
1117 | XFreePixmap (dpy, pixmap); |
1117 | XFreePixmap (dpy, pixmap); |
1118 | |
1118 | |
… | |
… | |
1168 | /* we need to re-generate transparency pixmap in that case ! */ |
1168 | /* we need to re-generate transparency pixmap in that case ! */ |
1169 | background_flags = make_transparency_pixmap (); |
1169 | background_flags = make_transparency_pixmap (); |
1170 | if (background_flags == 0) |
1170 | if (background_flags == 0) |
1171 | return false; |
1171 | return false; |
1172 | else if ((background_flags & transpTransformations) == (flags & transpTransformations) |
1172 | else if ((background_flags & transpTransformations) == (flags & transpTransformations) |
1173 | && pmap_depth == target->depth) |
1173 | && pmap_depth == target->depth) |
1174 | flags = flags & ~isInvalid; |
1174 | flags = flags & ~isInvalid; |
1175 | } |
1175 | } |
1176 | # endif |
1176 | # endif |
1177 | |
1177 | |
1178 | # ifdef HAVE_AFTERIMAGE |
1178 | # ifdef HAVE_AFTERIMAGE |
… | |
… | |
1242 | |
1242 | |
1243 | XFreeGC (target->dpy, gc); |
1243 | XFreeGC (target->dpy, gc); |
1244 | flags = flags & ~isInvalid; |
1244 | flags = flags & ~isInvalid; |
1245 | } |
1245 | } |
1246 | |
1246 | |
1247 | XDestroyImage (result); |
1247 | XDestroyImage (result); |
1248 | } |
1248 | } |
1249 | |
1249 | |
1250 | if (flags & isInvalid) |
1250 | if (flags & isInvalid) |
1251 | { |
1251 | { |
1252 | if (pixmap != None) |
1252 | if (pixmap != None) |