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.72 by sasha, Thu Aug 23 20:53:36 2007 UTC vs.
Revision 1.76 by sasha, Wed Sep 12 19:51:41 2007 UTC

94# ifdef XPM_BACKGROUND 94# ifdef XPM_BACKGROUND
95# ifdef HAVE_AFTERIMAGE 95# ifdef HAVE_AFTERIMAGE
96 if (original_asim != NULL) 96 if (original_asim != NULL)
97# endif 97# endif
98 { 98 {
99 if (h_scale != 0 || v_scale != 0) 99 if (h_scale != 0 || v_scale != 0
100 || h_align != 0 || v_align != 0)
100 return true; 101 return true;
101 } 102 }
102# endif 103# endif
103# ifdef ENABLE_TRANSPARENCY 104# ifdef ENABLE_TRANSPARENCY
104 if (flags & isTransparent) 105 if (flags & isTransparent)
114 return true; 115 return true;
115# endif 116# endif
116# ifdef ENABLE_TRANSPARENCY 117# ifdef ENABLE_TRANSPARENCY
117 if (flags & isTransparent) 118 if (flags & isTransparent)
118 { 119 {
119 if ((flags & blurNeeded) 120 if (((flags & blurNeeded) && !(flags & blurServerSide))
120 || ((flags & tintNeeded) && !(flags & tintServerSide))) 121 || ((flags & tintNeeded) && !(flags & tintServerSide)))
121 return true; 122 return true;
122 } 123 }
123# endif 124# endif
124 return false; 125 return false;
582 583
583 if (*file != '\0') 584 if (*file != '\0')
584 { 585 {
585# ifdef HAVE_AFTERIMAGE 586# ifdef HAVE_AFTERIMAGE
586 if (target->asimman == NULL) 587 if (target->asimman == NULL)
587 target->asimman = create_generic_imageman(target->rs[Rs_path]); 588 target->asimman = create_generic_imageman (target->rs[Rs_path]);
588 if ((f = strchr (file, ';')) == NULL) 589 if ((f = strchr (file, ';')) == NULL)
589 original_asim = get_asimage( target->asimman, file, 0xFFFFFFFF, 100 ); 590 original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100);
590 else 591 else
591 { 592 {
592 size_t len = f - file; 593 size_t len = f - file;
593 f = (char *)malloc (len + 1); 594 f = (char *)malloc (len + 1);
594 strncpy (f, file, len); 595 strncpy (f, file, len);
595 f[len] = '\0'; 596 f[len] = '\0';
596 original_asim = get_asimage( target->asimman, f, 0xFFFFFFFF, 100 ); 597 original_asim = get_asimage (target->asimman, f, 0xFFFFFFFF, 100);
597 free( f ); 598 free (f);
598 } 599 }
599 return (original_asim != NULL); 600 return (original_asim != NULL);
600# endif 601# endif
601 } 602 }
602 return false; 603 return false;
611 if (!(flags & isTransparent)) 612 if (!(flags & isTransparent))
612 { 613 {
613 flags |= isTransparent; 614 flags |= isTransparent;
614 return true; 615 return true;
615 } 616 }
617 return false;
616} 618}
617 619
618bool 620bool
619bgPixmap_t::set_blur_radius (const char *geom) 621bgPixmap_t::set_blur_radius (const char *geom)
620{ 622{
621 int changed = 0; 623 int changed = 0;
622 unsigned int hr, vr; 624 unsigned int hr, vr;
623 int junk; 625 int junk;
624 int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr); 626 int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr);
627
625 if (!(geom_flags&WidthValue)) 628 if (!(geom_flags&WidthValue))
626 hr = 1; 629 hr = 1;
627 if (!(geom_flags&HeightValue)) 630 if (!(geom_flags&HeightValue))
628 vr = hr; 631 vr = hr;
629 632
630 if (h_blurRadius != hr) 633 if (h_blurRadius != hr)
631 { 634 {
632 ++changed; 635 ++changed;
633 h_blurRadius = hr; 636 h_blurRadius = hr;
634 } 637 }
638
635 if (v_blurRadius != vr) 639 if (v_blurRadius != vr)
636 { 640 {
637 ++changed; 641 ++changed;
638 v_blurRadius = vr; 642 v_blurRadius = vr;
639 } 643 }
644
640 if (v_blurRadius == 0 && h_blurRadius == 0) 645 if (v_blurRadius == 0 && h_blurRadius == 0)
641 flags &= ~blurNeeded; 646 flags &= ~blurNeeded;
642 else 647 else
643 flags |= blurNeeded; 648 flags |= blurNeeded;
649
644 return (changed>0); 650 return (changed>0);
645} 651}
646 652
647static inline unsigned long 653static inline unsigned long
648compute_tint_shade_flags (rxvt_color *tint, int shade) 654compute_tint_shade_flags (rxvt_color *tint, int shade)
675 if (flags & bgPixmap_t::tintNeeded) 681 if (flags & bgPixmap_t::tintNeeded)
676 { 682 {
677 if (flags & bgPixmap_t::tintWholesome) 683 if (flags & bgPixmap_t::tintWholesome)
678 flags |= bgPixmap_t::tintServerSide; 684 flags |= bgPixmap_t::tintServerSide;
679#if XFT 685#if XFT
680 /* TODO: add logic for XRENDER tinting */
681 flags |= bgPixmap_t::tintServerSide; 686 flags |= bgPixmap_t::tintServerSide;
682#endif 687#endif
683 } 688 }
684 689
685 return flags; 690 return flags;
726 flags = (flags & ~tintFlags) | new_flags; 731 flags = (flags & ~tintFlags) | new_flags;
727 return true; 732 return true;
728 } 733 }
729 return false; 734 return false;
730} 735}
731
732 736
733/* make_transparency_pixmap() 737/* make_transparency_pixmap()
734 * Builds a pixmap sized the same as terminal window, with depth same as the root window 738 * Builds a pixmap sized the same as terminal window, with depth same as the root window
735 * that pixmap contains tiled portion of the root pixmap that is supposed to be covered by 739 * that pixmap contains tiled portion of the root pixmap that is supposed to be covered by
736 * our window. 740 * our window.
769 {/* we want to validate the pixmap and get it's size at the same time : */ 773 {/* we want to validate the pixmap and get it's size at the same time : */
770 int junk; 774 int junk;
771 unsigned int ujunk; 775 unsigned int ujunk;
772 /* root pixmap may be bad - allow a error */ 776 /* root pixmap may be bad - allow a error */
773 target->allowedxerror = -1; 777 target->allowedxerror = -1;
778
774 if (!XGetGeometry (dpy, root_pixmap, &root, &junk, &junk, &root_pmap_width, &root_pmap_height, &ujunk, &ujunk)) 779 if (!XGetGeometry (dpy, root_pixmap, &root, &junk, &junk, &root_pmap_width, &root_pmap_height, &ujunk, &ujunk))
775 root_pixmap = None; 780 root_pixmap = None;
781
776 target->allowedxerror = 0; 782 target->allowedxerror = 0;
777 } 783 }
778 784
779 Pixmap tiled_root_pmap = XCreatePixmap (dpy, root, window_width, window_height, root_depth); 785 Pixmap tiled_root_pmap = XCreatePixmap (dpy, root, window_width, window_height, root_depth);
780 GC gc = NULL; 786 GC gc = NULL;
804 XEvent event; 810 XEvent event;
805 int ev_count = 0; 811 int ev_count = 0;
806 XGrabServer (dpy); 812 XGrabServer (dpy);
807 XMapRaised (dpy, src); 813 XMapRaised (dpy, src);
808 XSync (dpy, False); 814 XSync (dpy, False);
815
809 /* XSync should get window where it's properly exposed, 816 /* XSync should get window where it's properly exposed,
810 * but to be on the safe side - let's check for the actuall event to arrive : */ 817 * but to be on the safe side - let's check for the actuall event to arrive : */
811 while (XCheckWindowEvent (dpy, src, ExposureMask, &event)) 818 while (XCheckWindowEvent (dpy, src, ExposureMask, &event))
812 ++ev_count; 819 ++ev_count;
820
813 if (ev_count > 0); 821 if (ev_count > 0);
814 { /* hooray! - we can grab the image! */ 822 { /* hooray! - we can grab the image! */
815 gc = XCreateGC (dpy, root, 0, NULL); 823 gc = XCreateGC (dpy, root, 0, NULL);
816 if (gc) 824 if (gc)
817 { 825 {
821 } 829 }
822 XDestroyWindow (dpy, src); 830 XDestroyWindow (dpy, src);
823 XUngrabServer (dpy); 831 XUngrabServer (dpy);
824 //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count); 832 //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count);
825 } 833 }
834
826 if (!success) 835 if (!success)
827 { 836 {
828 XFreePixmap (dpy, tiled_root_pmap); 837 XFreePixmap (dpy, tiled_root_pmap);
829 tiled_root_pmap = None; 838 tiled_root_pmap = None;
830 } 839 }
833 } 842 }
834 else 843 else
835 {/* strightforward pixmap copy */ 844 {/* strightforward pixmap copy */
836 gcv.tile = root_pixmap; 845 gcv.tile = root_pixmap;
837 gcv.fill_style = FillTiled; 846 gcv.fill_style = FillTiled;
847
838 while (sx < 0) sx += (int)window_width; 848 while (sx < 0) sx += (int)window_width;
839 while (sy < 0) sy += (int)window_height; 849 while (sy < 0) sy += (int)window_height;
850
840 gcv.ts_x_origin = -sx; 851 gcv.ts_x_origin = -sx;
841 gcv.ts_y_origin = -sy; 852 gcv.ts_y_origin = -sy;
842 gc = XCreateGC (dpy, root, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); 853 gc = XCreateGC (dpy, root, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv);
854
843 if (gc) 855 if (gc)
844 { 856 {
845 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); 857 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height);
846 result |= transpPmapTiled; 858 result |= transpPmapTiled;
847 } 859 }
848 } 860 }
849 TIMING_TEST_PRINT_RESULT (tp); 861 TIMING_TEST_PRINT_RESULT (tp);
850 862
851 if (tiled_root_pmap != None) 863 if (tiled_root_pmap != None)
852 { 864 {
853 if ((flags & tintNeeded) && !need_client_side_rendering ()) 865 if (!need_client_side_rendering ())
866 {
867 if ((flags & tintNeeded))
854 { 868 {
855 if (flags & tintWholesome) 869 if (flags & tintWholesome)
856 { 870 {
857 /* In this case we can tint image server-side getting significant 871 /* In this case we can tint image server-side getting significant
858 * performance improvements, as we eliminate XImage transfer 872 * performance improvements, as we eliminate XImage transfer
859 */ 873 */
860 gcv.foreground = Pixel (tint); 874 gcv.foreground = Pixel (tint);
861 gcv.function = GXand; 875 gcv.function = GXand;
862 gcv.fill_style = FillSolid; 876 gcv.fill_style = FillSolid;
863 if (gc) 877 if (gc)
864 XChangeGC (dpy, gc, GCFillStyle | GCForeground | GCFunction, &gcv); 878 XChangeGC (dpy, gc, GCFillStyle | GCForeground | GCFunction, &gcv);
879 else
880 gc = XCreateGC (dpy, root, GCFillStyle | GCForeground | GCFunction, &gcv);
881 if (gc)
882 {
883 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height);
884 result |= transpPmapTinted;
885 }
886 }
865 else 887 else
866 gc = XCreateGC (dpy, root, GCFillStyle | GCForeground | GCFunction, &gcv);
867 if (gc)
868 { 888 {
869 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); 889# if XFT
890 Picture back_pic = 0;
891 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
892
893 if (flags & tintSet)
894 tint.get (c);
895
896 if (shade > 0 && shade < 100)
897 {
898 c.r = (c.r * shade) / 100;
899 c.g = (c.g * shade) / 100;
900 c.b = (c.b * shade) / 100;
901 }
902 else if( shade > 100 && shade < 200)
903 {
904 c.r = (c.r * (200 - shade)) / 100;
905 c.g = (c.g * (200 - shade)) / 100;
906 c.b = (c.b * (200 - shade)) / 100;
907 }
908
909 XRenderPictFormat pf;
910 pf.type = PictTypeDirect;
911 pf.depth = 32;
912 pf.direct.redMask = 0xff;
913 pf.direct.greenMask = 0xff;
914 pf.direct.blueMask = 0xff;
915 pf.direct.alphaMask = 0xff;
916
917 XRenderPictFormat *solid_format = XRenderFindFormat (dpy,
918 (PictFormatType|
919 PictFormatDepth|
920 PictFormatRedMask|
921 PictFormatGreenMask|
922 PictFormatBlueMask|
923 PictFormatAlphaMask),
924 &pf,
925 0);
926 XRenderPictFormat *root_format = XRenderFindVisualFormat (dpy, DefaultVisualOfScreen (ScreenOfDisplay (dpy, target->display->screen)));
927 XRenderPictureAttributes pa ;
928
929 back_pic = XRenderCreatePicture (dpy, tiled_root_pmap, root_format, 0, &pa);
930
931 pa.repeat = True;
932
933 Pixmap overlay_pmap = XCreatePixmap (dpy, root, 1, 1, 32);
934 Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa);
935 XFreePixmap (dpy, overlay_pmap);
936
937 pa.component_alpha = True;
938 Pixmap mask_pmap = XCreatePixmap (dpy, root, 1, 1, 32);
939 Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat|CPComponentAlpha, &pa);
940 XFreePixmap (dpy, mask_pmap);
941
942 if (mask_pic && overlay_pic && back_pic)
943 {
944 XRenderColor mask_c;
945
946 memset (&mask_c, (shade > 100) ? 0xFF : 0x0, sizeof (mask_c));
947 mask_c.alpha = 0xffff;
948 XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1);
949 memset (&mask_c, 0x0, sizeof (mask_c));
950 mask_c.alpha = 0;
951
952 if (c.r == c.b && c.b == c.g) /* pure shading */
953 {
954 mask_c.red = mask_c.green = mask_c.blue = 0xffff - c.r;
955 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
956 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
957 }
958 else
959 {
960 mask_c.red = 0xffff - c.r;
961 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
962 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
963 mask_c.red = 0;
964 mask_c.green = 0xffff - c.g;
965 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
966 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
967 mask_c.green = 0;
968 mask_c.blue = 0xffff - c.b;
969 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
970 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
971 }
870 result |= transpPmapTinted; 972 result |= transpPmapTinted;
973 }
974 XRenderFreePicture (dpy, mask_pic);
975 XRenderFreePicture (dpy, overlay_pic);
976 XRenderFreePicture (dpy, back_pic);
977# if DO_TIMING_TEST
978 XSync (dpy, False);
979# endif
980# endif
871 } 981 }
872 } 982 }
873 else 983 } /* server side rendering completed */
874 {
875#if XFT /* TODO : implement proper detection of XRENDER, as XFT may be present without XRENDER ! */
876 rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
877 if (flags & tintSet)
878 tint.get (c);
879 if (shade > 0 && shade < 100)
880 {
881 c.r = (c.r * shade) / 100;
882 c.g = (c.g * shade) / 100;
883 c.b = (c.b * shade) / 100;
884 }
885 else if( shade > 100 && shade < 200)
886 {
887 c.r = (c.r * (200 - shade)) / 100;
888 c.g = (c.g * (200 - shade)) / 100;
889 c.b = (c.b * (200 - shade)) / 100;
890 }
891 984
892 XRenderPictFormat pf;
893 pf.type = PictTypeDirect;
894 pf.depth = 32;
895 pf.direct.redMask = 0xff;
896 pf.direct.greenMask = 0xff;
897 pf.direct.blueMask = 0xff;
898 pf.direct.alphaMask = 0xff;
899
900 XRenderPictFormat *solid_format = XRenderFindFormat (dpy,
901 (PictFormatType|
902 PictFormatDepth|
903 PictFormatRedMask|
904 PictFormatGreenMask|
905 PictFormatBlueMask|
906 PictFormatAlphaMask),
907 &pf,
908 0);
909 XRenderPictFormat *root_format = XRenderFindVisualFormat (dpy, DefaultVisualOfScreen (ScreenOfDisplay (dpy, target->display->screen)));
910 XRenderPictureAttributes pa ;
911
912 Picture back_pic = XRenderCreatePicture (dpy, tiled_root_pmap, root_format, 0, &pa);
913
914 pa.repeat = True;
915
916 Pixmap overlay_pmap = XCreatePixmap (dpy, root, 1, 1, 32);
917 Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa);
918 XFreePixmap (dpy, overlay_pmap);
919
920 pa.component_alpha = True;
921 Pixmap mask_pmap = XCreatePixmap (dpy, root, 1, 1, 32);
922 Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat|CPComponentAlpha, &pa);
923 XFreePixmap (dpy, mask_pmap);
924
925 if (mask_pic && overlay_pic && back_pic)
926 {
927 XRenderColor mask_c;
928
929 memset (&mask_c, (shade > 100) ? 0xFF : 0x0, sizeof(mask_c));
930 mask_c.alpha = 0xffff;
931 XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1);
932 memset (&mask_c, 0x0, sizeof(mask_c));
933 mask_c.alpha = 0;
934 if (c.r == c.b && c.b == c.g) /* pure shading */
935 {
936 mask_c.red = mask_c.green = mask_c.blue = 0xffff-c.r;
937 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
938 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
939 }
940 else
941 {
942 mask_c.red = 0xffff-c.r;
943 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
944 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
945 mask_c.red = 0;
946 mask_c.green = 0xffff-c.g;
947 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
948 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
949 mask_c.green = 0;
950 mask_c.blue = 0xffff-c.b;
951 XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1);
952 XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
953 }
954 result |= transpPmapTinted;
955 }
956 XRenderFreePicture (dpy, mask_pic);
957 XRenderFreePicture (dpy, overlay_pic);
958 XRenderFreePicture (dpy, back_pic);
959#endif
960 }
961 }
962 if (pixmap) 985 if (pixmap)
963 XFreePixmap (dpy, pixmap); 986 XFreePixmap (dpy, pixmap);
987
964 pixmap = tiled_root_pmap; 988 pixmap = tiled_root_pmap;
965 pmap_width = window_width; 989 pmap_width = window_width;
966 pmap_height = window_height; 990 pmap_height = window_height;
967 pmap_depth = root_depth; 991 pmap_depth = root_depth;
968 } 992 }
1078 tint.get (c); 1102 tint.get (c);
1079 ShadeXImage (target, result, shade, c.r, c.g, c.b); 1103 ShadeXImage (target, result, shade, c.r, c.g, c.b);
1080 } 1104 }
1081 } 1105 }
1082# endif /* HAVE_AFTERIMAGE */ 1106# endif /* HAVE_AFTERIMAGE */
1107
1083 if (result != NULL) 1108 if (result != NULL)
1084 { 1109 {
1085 GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL); 1110 GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL);
1086 if (gc) 1111 if (gc)
1087 { 1112 {
1148void 1173void
1149bgPixmap_t::apply() 1174bgPixmap_t::apply()
1150{ 1175{
1151 if (target) 1176 if (target)
1152 { 1177 {
1178 flags &= ~isVtOrigin;
1153 if (pixmap != None) 1179 if (pixmap != None)
1154 { /* set target's background to pixmap */ 1180 { /* set target's background to pixmap */
1155# ifdef ENABLE_TRANSPARENCY 1181# ifdef ENABLE_TRANSPARENCY
1156 if (flags & isTransparent) 1182 if (flags & isTransparent)
1157 { 1183 {
1163# endif 1189# endif
1164 } 1190 }
1165 else 1191 else
1166# endif 1192# endif
1167 { 1193 {
1194 flags |= isVtOrigin;
1168 /* force old pixmap dereference in case it was transparent before :*/ 1195 /* force old pixmap dereference in case it was transparent before :*/
1169 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); 1196 XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
1170 XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); 1197 XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap);
1171 /* do we also need to set scrollbar's background here ? */ 1198 /* do we also need to set scrollbar's background here ? */
1172# if HAVE_SCROLLBARS 1199# if HAVE_SCROLLBARS
1183# if HAVE_SCROLLBARS 1210# if HAVE_SCROLLBARS
1184 if (target->scrollBar.win) 1211 if (target->scrollBar.win)
1185 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]); 1212 XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
1186# endif 1213# endif
1187 } 1214 }
1215
1188 /* don't want Expose on the parent */ 1216 /* don't want Expose on the parent */
1189 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, False); 1217 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, False);
1190 /* do want Expose on the vt */ 1218 /* do want Expose on the vt, so we get refreshed properly */
1191 XClearArea (target->dpy, target->parent[0], 0, 0, 0, 0, True); 1219 XClearArea (target->dpy, target->vt, 0, 0, 0, 0, True);
1220
1192# if HAVE_SCROLLBARS 1221# if HAVE_SCROLLBARS
1193 if (target->scrollBar.win) 1222 if (target->scrollBar.win)
1194 { 1223 {
1195 target->scrollBar.setIdle (); 1224 target->scrollBar.setIdle ();
1196 target->scrollbar_show (0); 1225 target->scrollbar_show (0);
1197 } 1226 }
1198# endif 1227# endif
1199 /* Is that really neccessary? we did a XClearArea to generate Expose events alreday ! */
1200 target->want_refresh = 1;
1201# ifdef ENABLE_TRANSPARENCY
1202 target->want_full_refresh = 1;
1203# endif
1204 /* TODO: why do we need a flush here ??? It causes segfault on resize ! */
1205// target->flush ();
1206 } 1228 }
1207} 1229}
1208 1230
1209void 1231void
1210rxvt_term::get_window_origin (int &x, int &y) 1232rxvt_term::get_window_origin (int &x, int &y)
1218rxvt_term::get_pixmap_property (int prop_id) 1240rxvt_term::get_pixmap_property (int prop_id)
1219{ 1241{
1220 if (prop_id > 0 && prop_id < NUM_XA) 1242 if (prop_id > 0 && prop_id < NUM_XA)
1221 if (xa[prop_id]) 1243 if (xa[prop_id])
1222 { 1244 {
1223 int aformat, rootdepth; 1245 int aformat;
1224 unsigned long nitems, bytes_after; 1246 unsigned long nitems, bytes_after;
1225 Atom atype; 1247 Atom atype;
1226 unsigned char *prop = NULL; 1248 unsigned char *prop = NULL;
1227 int result = XGetWindowProperty (dpy, display->root, xa[prop_id], 1249 int result = XGetWindowProperty (dpy, display->root, xa[prop_id],
1228 0L, 1L, False, XA_PIXMAP, &atype, &aformat, 1250 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
1241 */ 1263 */
1242int 1264int
1243rxvt_term::update_background () 1265rxvt_term::update_background ()
1244{ 1266{
1245 bgPixmap.invalidate(); 1267 bgPixmap.invalidate();
1268
1246 /* no chance of real time refresh if we are blurring ! */ 1269 /* no chance of real time refresh if we are blurring ! */
1247 if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) 1270 if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded))
1248 bgPixmap.render(); 1271 bgPixmap.render();
1249 else 1272 else
1250 { 1273 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines