ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/xpm.C
(Generate patch)

Comparing rxvt-unicode/src/xpm.C (file contents):
Revision 1.65 by sasha, Fri Aug 10 22:10:36 2007 UTC vs.
Revision 1.71 by sasha, Fri Aug 17 22:01:33 2007 UTC

84 } 84 }
85# endif 85# endif
86# ifdef ENABLE_TRANSPARENCY 86# ifdef ENABLE_TRANSPARENCY
87 if (flags & isTransparent) 87 if (flags & isTransparent)
88 return true; 88 return true;
89# endif
90 return false;
91}
92
93bool bgPixmap_t::need_client_side_rendering ()
94{
95# ifdef HAVE_AFTERIMAGE
96 if (original_asim != NULL)
97 return true;
98# endif
99# ifdef ENABLE_TRANSPARENCY
100 if (flags & isTransparent)
101 {
102 if ((flags & blurNeeded)
103 || ((flags & tintNeeded) && !(flags & tintServerSide)))
104 return true;
105 }
89# endif 106# endif
90 return false; 107 return false;
91} 108}
92 109
93# ifdef XPM_BACKGROUND 110# ifdef XPM_BACKGROUND
597 if (v_blurRadius != vr) 614 if (v_blurRadius != vr)
598 { 615 {
599 ++changed; 616 ++changed;
600 v_blurRadius = vr; 617 v_blurRadius = vr;
601 } 618 }
619 if (v_blurRadius == 0 && h_blurRadius == 0)
620 flags &= ~blurNeeded;
621 else
622 flags |= blurNeeded;
602 return (changed>0); 623 return (changed>0);
603} 624}
604 625
605static inline unsigned long 626static inline unsigned long
606compute_tint_shade_flags (rxvt_color *tint, int shade) 627compute_tint_shade_flags (rxvt_color *tint, int shade)
612 else if (tint) 633 else if (tint)
613 { 634 {
614 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC); 635 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
615 tint->get (c); 636 tint->get (c);
616 637
617 flags |= bgPixmap_t::tintNeeded;
618 if ((c.r > 0x000700 || c.g > 0x000700 || c.b > 0x000700) 638 if ((c.r > 0x000700 || c.g > 0x000700 || c.b > 0x000700)
619 && (c.r < 0x00f700 || c.g < 0x00f700 || c.b < 0x00f700)) 639 && (c.r < 0x00f700 || c.g < 0x00f700 || c.b < 0x00f700))
620 { 640 {
621 flags |= bgPixmap_t::tintNeeded; 641 flags |= bgPixmap_t::tintNeeded;
622#define IS_COMPONENT_WHOLESOME(cmp) ((cmp) <= 0x000700 || (cmp) >= 0x00f700) 642# define IS_COMPONENT_WHOLESOME(cmp) ((cmp) <= 0x000700 || (cmp) >= 0x00f700)
623 if (IS_COMPONENT_WHOLESOME (c.r) 643 if (IS_COMPONENT_WHOLESOME (c.r)
624 && IS_COMPONENT_WHOLESOME (c.g) 644 && IS_COMPONENT_WHOLESOME (c.g)
625 && IS_COMPONENT_WHOLESOME (c.b)) 645 && IS_COMPONENT_WHOLESOME (c.b))
626 flags |= bgPixmap_t::tintServerSide; 646 flags |= bgPixmap_t::tintServerSide;
627#undef IS_COMPONENT_WHOLESOME 647# undef IS_COMPONENT_WHOLESOME
628 } 648 }
629 } 649 }
630 return flags; 650 return flags;
631} 651}
632 652
678/* make_transparency_pixmap() 698/* make_transparency_pixmap()
679 * Builds a pixmap sized the same as terminal window, with depth same as the root window 699 * Builds a pixmap sized the same as terminal window, with depth same as the root window
680 * that pixmap contains tiled portion of the root pixmap that is supposed to be covered by 700 * that pixmap contains tiled portion of the root pixmap that is supposed to be covered by
681 * our window. 701 * our window.
682 */ 702 */
683bool 703unsigned long
684bgPixmap_t::make_transparency_pixmap () 704bgPixmap_t::make_transparency_pixmap ()
685{ 705{
706 unsigned long result = 0;
707
686 if (target == NULL) 708 if (target == NULL)
687 return false; 709 return 0;
688 710
689 /* root dimentions may change from call to call - but Display structure should 711 /* root dimentions may change from call to call - but Display structure should
690 * be always up-to-date, so let's use it : 712 * be always up-to-date, so let's use it :
691 */ 713 */
692 Window root = target->display->root; 714 Window root = target->display->root;
703 target->get_window_origin (sx, sy); 725 target->get_window_origin (sx, sy);
704 726
705 /* check if we are outside of the visible part of the virtual screen : */ 727 /* check if we are outside of the visible part of the virtual screen : */
706 if (sx + window_width <= 0 || sy + window_height <= 0 728 if (sx + window_width <= 0 || sy + window_height <= 0
707 || sx >= root_width || sy >= root_height) 729 || sx >= root_width || sy >= root_height)
708 return false; 730 return 0;
709 731
710 if (root_pixmap != None) 732 if (root_pixmap != None)
711 {/* we want to validate the pixmap and get it's size at the same time : */ 733 {/* we want to validate the pixmap and get it's size at the same time : */
712 int junk; 734 int junk;
713 unsigned int ujunk; 735 unsigned int ujunk;
720 742
721 Pixmap tiled_root_pmap = XCreatePixmap (dpy, root, window_width, window_height, root_depth); 743 Pixmap tiled_root_pmap = XCreatePixmap (dpy, root, window_width, window_height, root_depth);
722 GC gc = NULL; 744 GC gc = NULL;
723 745
724 if (tiled_root_pmap == None) /* something really bad happened - abort */ 746 if (tiled_root_pmap == None) /* something really bad happened - abort */
725 return false; 747 return 0;
726 748
727 if (root_pixmap == None) 749 if (root_pixmap == None)
728 { /* use tricks to obtain the root background image :*/ 750 { /* use tricks to obtain the root background image :*/
729 /* we want to create Overrideredirect window overlapping out window 751 /* we want to create Overrideredirect window overlapping out window
730 with background type of Parent Relative and then grab it */ 752 with background type of Parent Relative and then grab it */
753 while (XCheckWindowEvent (dpy, src, ExposureMask, &event)) 775 while (XCheckWindowEvent (dpy, src, ExposureMask, &event))
754 ++ev_count; 776 ++ev_count;
755 if (ev_count > 0); 777 if (ev_count > 0);
756 { /* hooray! - we can grab the image! */ 778 { /* hooray! - we can grab the image! */
757 gc = XCreateGC (dpy, root, 0, NULL); 779 gc = XCreateGC (dpy, root, 0, NULL);
780 if (gc)
781 {
758 XCopyArea (dpy, src, tiled_root_pmap, gc, 0, 0, window_width, window_height, 0, 0); 782 XCopyArea (dpy, src, tiled_root_pmap, gc, 0, 0, window_width, window_height, 0, 0);
759 success = true; 783 success = true;
784 }
760 } 785 }
761 XDestroyWindow (dpy, src); 786 XDestroyWindow (dpy, src);
762 XUngrabServer (dpy); 787 XUngrabServer (dpy);
763 //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count); 788 //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count);
764 } 789 }
765 if (!success) 790 if (!success)
766 { 791 {
767 XFreePixmap (dpy, tiled_root_pmap); 792 XFreePixmap (dpy, tiled_root_pmap);
768 tiled_root_pmap = None; 793 tiled_root_pmap = None;
769 } 794 }
795 else
796 result |= transpPmapTiled;
770 } 797 }
771 else 798 else
772 {/* strightforward pixmap copy */ 799 {/* strightforward pixmap copy */
773 gcv.tile = root_pixmap; 800 gcv.tile = root_pixmap;
774 gcv.fill_style = FillTiled; 801 gcv.fill_style = FillTiled;
775 while (sx < 0) sx += (int)window_width; 802 while (sx < 0) sx += (int)window_width;
776 while (sy < 0) sy += (int)window_height; 803 while (sy < 0) sy += (int)window_height;
777 gcv.ts_x_origin = -sx; 804 gcv.ts_x_origin = -sx;
778 gcv.ts_y_origin = -sy; 805 gcv.ts_y_origin = -sy;
779 gc = XCreateGC (dpy, root, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); 806 gc = XCreateGC (dpy, root, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv);
807 if (gc)
808 {
780 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); 809 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height);
810 result |= transpPmapTiled;
811 }
781 } 812 }
782 813
783 if (tiled_root_pmap != None) 814 if (tiled_root_pmap != None)
784 { 815 {
785 if (flags & tintNeeded) 816 if (flags & tintNeeded && !need_client_side_rendering ())
786 { 817 {
787 if ((flags & tintServerSide)
788 && h_blurRadius <= 1 && v_blurRadius <= 1
789# ifdef HAVE_AFTERIMAGE
790 && original_asim == NULL
791# endif
792 )
793 { /* In this case we can tint image server-side getting significant 818 /* In this case we can tint image server-side getting significant
794 * performance improvements, as we eliminate XImage transfer 819 * performance improvements, as we eliminate XImage transfer
795 */ 820 */
796 gcv.foreground = Pixel (tint); 821 gcv.foreground = Pixel (tint);
797 gcv.function = GXand; 822 gcv.function = GXand;
798 gcv.fill_style = FillSolid; 823 gcv.fill_style = FillSolid;
799 if (gc) 824 if (gc)
800 XChangeGC (dpy, gc, GCFillStyle | GCForeground | GCFunction, &gcv); 825 XChangeGC (dpy, gc, GCFillStyle | GCForeground | GCFunction, &gcv);
801 else 826 else
802 gc = XCreateGC (dpy, root, GCFillStyle | GCForeground | GCFunction, &gcv); 827 gc = XCreateGC (dpy, root, GCFillStyle | GCForeground | GCFunction, &gcv);
828 if (gc)
829 {
803 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); 830 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height);
831 result |= transpPmapTinted;
804 } 832 }
805 } 833 }
806 if (pixmap) 834 if (pixmap)
807 XFreePixmap (dpy, pixmap); 835 XFreePixmap (dpy, pixmap);
808 pixmap = tiled_root_pmap; 836 pixmap = tiled_root_pmap;
811 pmap_depth = root_depth; 839 pmap_depth = root_depth;
812 } 840 }
813 841
814 if (gc) 842 if (gc)
815 XFreeGC (dpy, gc); 843 XFreeGC (dpy, gc);
844
845 return result;
816} 846}
817 847
818bool 848bool
819bgPixmap_t::set_root_pixmap () 849bgPixmap_t::set_root_pixmap ()
820{ 850{
831 } 861 }
832 return false; 862 return false;
833} 863}
834# endif /* ENABLE_TRANSPARENCY */ 864# endif /* ENABLE_TRANSPARENCY */
835 865
866# ifndef HAVE_AFTERIMAGE
867static void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm);
868# endif
869
870
836bool 871bool
837bgPixmap_t::render_background () 872bgPixmap_t::render ()
838{ 873{
839 /* TODO: temporary implementation - need to move check_parents stuff in here */ 874 unsigned long background_flags = 0;
875
876 if (target == NULL)
877 return false;
878
879 invalidate();
840# ifdef ENABLE_TRANSPARENCY 880# ifdef ENABLE_TRANSPARENCY
841 if (flags & isTransparent) 881 if (flags & isTransparent)
842 { 882 {
843 /* we need to re-generate transparency pixmap in that case ! */ 883 /* we need to re-generate transparency pixmap in that case ! */
844 target->check_our_parents (); 884 background_flags = make_transparency_pixmap ();
845 return true; 885 if (background_flags == 0)
886 return false;
887 else if ((background_flags & transpTransformations) == (flags & transpTransformations)
888 && pmap_depth == target->depth)
889 flags = flags & ~isInvalid;
846 } 890 }
847# endif 891# endif
892
893 XImage *result = NULL;
848# ifdef HAVE_AFTERIMAGE 894# ifdef HAVE_AFTERIMAGE
849 render_asim (NULL, TINT_LEAVE_SAME); 895 if (original_asim
850 apply_background (); 896 || (background_flags & transpTransformations) != (flags & transpTransformations))
897 {
898 ASImage *background = NULL;
899 ARGB32 as_tint = TINT_LEAVE_SAME;
900 if (background_flags)
901 background = pixmap2ximage (target->asv, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, 100);
902
903# ifdef ENABLE_TRANSPARENCY
904 if (!(background_flags & transpPmapTinted) && (flags & tintNeeded))
905 {
906 ShadingInfo as_shade;
907 as_shade.shading = (shade == 0) ? 100 : shade;
908
909 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
910 if (flags & tintSet)
911 tint.get (c);
912 as_shade.tintColor.red = c.r;
913 as_shade.tintColor.green = c.g;
914 as_shade.tintColor.blue = c.b;
915
916 as_tint = shading2tint32 (&as_shade);
917 }
918 if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL)
919 {
920 ASImage* tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF,
921 (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
922 100, ASIMAGE_QUALITY_DEFAULT);
923 if (tmp)
924 {
925 destroy_asimage (&background);
926 background = tmp;
927 }
928 }
929# endif
930
931 if (render_asim (background, as_tint))
932 flags = flags & ~isInvalid;
933 if (background)
934 destroy_asimage (&background);
935 }
936 else if (background_flags && pmap_depth != target->depth)
937 {
938 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap);
939 }
940# else /* our own client-side tinting */
941 if (background_flags && (flags & isInvalid))
942 {
943 result = XGetImage (target->dpy, pixmap, 0, 0, pmap_width, pmap_height, AllPlanes, ZPixmap);
944 if (result != NULL && !(background_flags & transpPmapTinted) && (flags & tintNeeded))
945 {
946 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
947 if (flags & tintSet)
948 tint.get (c);
949 ShadeXImage (target, result, shade, c.r, c.g, c.b);
950 }
951 }
952# endif /* HAVE_AFTERIMAGE */
953 if (result != NULL)
954 {
955 GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL);
956 if (gc)
957 {
958 if (/*pmap_depth != target->depth &&*/ pixmap != None)
959 {
960 XFreePixmap (target->dpy, pixmap);
961 pixmap = None;
962 }
963 if (pixmap == None)
964 {
965 pixmap = XCreatePixmap (target->dpy, target->vt, result->width, result->height, target->depth);
966 pmap_width = result->width;
967 pmap_height = result->height;
968 pmap_depth = target->depth;
969 }
970 if (pmap_depth != result->depth)
971 { /* Bad Match error will ensue ! stupid X !!!! */
972 if( result->depth == 24 && pmap_depth == 32)
973 result->depth = 32;
974 else if( result->depth == 32 && pmap_depth == 24)
975 result->depth = 24;
976 else
977 {
978 /* TODO: implement image recoding */
979 }
980 }
981 if (pmap_depth == result->depth)
982 XPutImage (target->dpy, pixmap, gc, result, 0, 0, 0, 0, result->width, result->height);
983 XFreeGC (target->dpy, gc);
984 flags = flags & ~isInvalid;
985 }
986 XDestroyImage (result);
987 }
988
989 if (flags & isInvalid)
990 {
991 if (pixmap != None)
992 {
993 XFreePixmap (target->dpy, pixmap);
994 pixmap = None;
995 }
996 }
997
998 apply ();
999
851 return true; 1000 return true;
852# endif
853 return false;
854} 1001}
855 1002
856bool 1003bool
857bgPixmap_t::set_target (rxvt_term *new_target) 1004bgPixmap_t::set_target (rxvt_term *new_target)
858{ 1005{
867 } 1014 }
868 return false; 1015 return false;
869} 1016}
870 1017
871void 1018void
872bgPixmap_t::apply_background() 1019bgPixmap_t::apply()
873{ 1020{
874 if (target) 1021 if (target)
875 { 1022 {
876 if (pixmap != None) 1023 if (pixmap != None)
877 { /* set target's background to pixmap */ 1024 { /* set target's background to pixmap */
878# ifdef ENABLE_TRANSPARENCY 1025# ifdef ENABLE_TRANSPARENCY
879 if (flags & isTransparent) 1026 if (flags & isTransparent)
880 { 1027 {
881 XSetWindowBackgroundPixmap (target->dpy, target->parent[0], pixmap); 1028 XSetWindowBackgroundPixmap (target->dpy, target->parent[0], pixmap);
882 XSetWindowBackgroundPixmap (target->dpy, target->vt, ParentRelative); 1029 XSetWindowBackgroundPixmap (target->dpy, target->vt, ParentRelative);
1030# if HAVE_SCROLLBARS
883 if (target->scrollBar.win) 1031 if (target->scrollBar.win)
884 XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative); 1032 XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative);
1033# endif
885 } 1034 }
886 else 1035 else
887# endif 1036# endif
888 { 1037 {
889 /* force old pixmap dereference in case it was transparent before :*/ 1038 /* force old pixmap dereference in case it was transparent before :*/
890 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_bg]); 1039 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
891 XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); 1040 XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap);
892 /* do we also need to set scrollbar's background here ? */ 1041 /* do we also need to set scrollbar's background here ? */
1042# if HAVE_SCROLLBARS
1043 if (target->scrollBar.win)
1044 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
1045# endif
893 } 1046 }
894 } 1047 }
895 else 1048 else
896 { /* set target background to a pixel */ 1049 { /* set target background to a pixel */
897 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_bg]); 1050 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
898 XSetWindowBackground (target->dpy, target->vt, target->pix_colors[Color_bg]); 1051 XSetWindowBackground (target->dpy, target->vt, target->pix_colors[Color_bg]);
899 /* do we also need to set scrollbar's background here ? */ 1052 /* do we also need to set scrollbar's background here ? */
1053# if HAVE_SCROLLBARS
1054 if (target->scrollBar.win)
1055 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
1056# endif
900 } 1057 }
901 /* don't want Expose on the parent */ 1058 /* don't want Expose on the parent */
902 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, False); 1059 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, False);
903 /* do want Expose on the vt */ 1060 /* do want Expose on the vt */
904 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, True); 1061 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, True);
1062# if HAVE_SCROLLBARS
1063 if (target->scrollBar.win)
1064 {
1065 target->scrollBar.setIdle ();
1066 target->scrollbar_show (0);
1067 }
1068# endif
1069 /* Is that really neccessary? we did a XClearArea to generate Expose events alreday ! */
1070 target->want_refresh = 1;
1071# ifdef ENABLE_TRANSPARENCY
1072 target->want_full_refresh = 1;
1073# endif
1074 /* TODO: why do we need a flush here ??? It causes segfault on resize ! */
1075// target->flush ();
905 } 1076 }
906} 1077}
907#endif /* HAVE_BG_PIXMAP */
908
909 1078
910void 1079void
911rxvt_term::get_window_origin (int &x, int &y) 1080rxvt_term::get_window_origin (int &x, int &y)
912{ 1081{
913 Window cr; 1082 Window cr;
914 XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); 1083 XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr);
1084/* fprintf( stderr, "origin is %+d%+d\n", x, y);*/
915} 1085}
916 1086
917Pixmap 1087Pixmap
918rxvt_term::get_pixmap_property (int prop_id) 1088rxvt_term::get_pixmap_property (int prop_id)
919{ 1089{
933 } 1103 }
934 } 1104 }
935 return None; 1105 return None;
936} 1106}
937 1107
1108/*
1109 * Check our parents are still who we think they are.
1110 * Do transparency updates if required
1111 */
1112int
1113rxvt_term::update_background ()
1114{
1115 bgPixmap.invalidate();
1116 /* no chance of real time refresh if we are blurring ! */
1117 if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded))
1118 bgPixmap.render();
1119 else
1120 {
1121 update_background_ev.stop ();
1122 if (!bgPixmap.need_client_side_rendering())
1123 update_background_ev.start (NOW + .05);
1124 else if (bgPixmap.flags & bgPixmap_t::blurNeeded)
1125 update_background_ev.start (NOW + .2); /* very slow !!! */
1126 else
1127 update_background_ev.start (NOW + .07);
1128 }
1129 return 0;
1130}
938 1131
939#ifdef ENABLE_TRANSPARENCY 1132void
940#ifndef HAVE_AFTERIMAGE 1133rxvt_term::update_background_cb (time_watcher &w)
1134{
1135 bgPixmap.render ();
1136}
1137#endif /* HAVE_BG_PIXMAP */
1138
1139#if defined(ENABLE_TRANSPARENCY) && !defined(HAVE_AFTERIMAGE)
941/* taken from aterm-0.4.2 */ 1140/* taken from aterm-0.4.2 */
942 1141
943typedef uint32_t RUINT32T; 1142typedef uint32_t RUINT32T;
944 1143
945static void 1144static void
952 unsigned int upper_lim_r, upper_lim_g, upper_lim_b; 1151 unsigned int upper_lim_r, upper_lim_g, upper_lim_b;
953 int i; 1152 int i;
954 1153
955 Visual *visual = term->visual; 1154 Visual *visual = term->visual;
956 1155
957 if( visual->c_class != TrueColor || srcImage->format != ZPixmap ) return ; 1156 if (visual->c_class != TrueColor || srcImage->format != ZPixmap) return ;
958 1157
1158 if (shade == 0)
1159 shade = 100;
1160
959 /* for convenience */ 1161 /* for convenience */
960 mask_r = visual->red_mask; 1162 mask_r = visual->red_mask;
961 mask_g = visual->green_mask; 1163 mask_g = visual->green_mask;
962 mask_b = visual->blue_mask; 1164 mask_b = visual->blue_mask;
963 1165
1165 } 1367 }
1166 } 1368 }
1167 1369
1168 free (lookup); 1370 free (lookup);
1169} 1371}
1170#endif 1372#endif /* defined(ENABLE_TRANSPARENCY) && !defined(HAVE_AFTERIMAGE) */
1171 1373
1172/* 1374#if 0 /* replaced by a bgPixmap_t::render() - leve here temporarily for reference */
1173 * Check our parents are still who we think they are.
1174 * Do transparency updates if required
1175 */
1176int
1177rxvt_term::check_our_parents ()
1178{
1179 check_our_parents_ev.stop ();
1180 check_our_parents_ev.start (NOW + .1);
1181 return 0;
1182}
1183
1184void 1375void
1185rxvt_term::check_our_parents_cb (time_watcher &w) 1376rxvt_term::check_our_parents_cb (time_watcher &w)
1186{ 1377{
1378
1187 int i, aformat, rootdepth; 1379 int i, aformat, rootdepth;
1188 unsigned long nitems, bytes_after; 1380 unsigned long nitems, bytes_after;
1189 Atom atype; 1381 Atom atype;
1190 unsigned char *prop = NULL; 1382 unsigned char *prop = NULL;
1191 Window root, oldp, *list; 1383 Window root, oldp, *list;
1364 PRINT_BACKGROUND_OP_TIME; 1556 PRINT_BACKGROUND_OP_TIME;
1365 1557
1366 if (gc != NULL) 1558 if (gc != NULL)
1367 XFreeGC (dpy, gc); 1559 XFreeGC (dpy, gc);
1368 1560
1369 bgPixmap.apply_background(); 1561 bgPixmap.apply();
1370 if (!success) 1562 if (!success)
1371 am_pixmap_trans = 0; 1563 am_pixmap_trans = 0;
1372 else 1564 else
1373 { 1565 {
1374 am_transparent = am_pixmap_trans = 1; 1566 am_transparent = am_pixmap_trans = 1;
1389 if (am_pixmap_trans) 1581 if (am_pixmap_trans)
1390 flush (); 1582 flush ();
1391 } 1583 }
1392 } 1584 }
1393} 1585}
1394#endif 1586#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines