aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/src/xterm.c b/src/xterm.c
index ab1c03e4da5..6acc03e51f6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -906,7 +906,16 @@ x_draw_row_bitmaps (w, row)
906 906
907 if (top_line_height < 0) 907 if (top_line_height < 0)
908 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w); 908 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
909 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); 909
910 /* In case the same realized face is used for bitmap areas and
911 for something displayed in the text (e.g. face `region' on
912 mono-displays, the fill style may have been changed to
913 FillSolid in x_draw_glyph_string_background. */
914 if (face->stipple)
915 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled);
916 else
917 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background);
918
910 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 919 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
911 face->gc, 920 face->gc,
912 (left 921 (left
@@ -916,7 +925,8 @@ x_draw_row_bitmaps (w, row)
916 row->y)), 925 row->y)),
917 FRAME_X_FLAGS_AREA_WIDTH (f) - border, 926 FRAME_X_FLAGS_AREA_WIDTH (f) - border,
918 row->visible_height); 927 row->visible_height);
919 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); 928 if (!face->stipple)
929 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
920 } 930 }
921 931
922 /* Draw the left bitmap. */ 932 /* Draw the left bitmap. */
@@ -941,7 +951,15 @@ x_draw_row_bitmaps (w, row)
941 951
942 if (top_line_height < 0) 952 if (top_line_height < 0)
943 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w); 953 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w);
944 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); 954
955 /* In case the same realized face is used for bitmap areas and
956 for something displayed in the text (e.g. face `region' on
957 mono-displays, the fill style may have been changed to
958 FillSolid in x_draw_glyph_string_background. */
959 if (face->stipple)
960 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled);
961 else
962 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background);
945 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 963 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
946 face->gc, 964 face->gc,
947 right, 965 right,
@@ -949,7 +967,8 @@ x_draw_row_bitmaps (w, row)
949 row->y)), 967 row->y)),
950 FRAME_X_FLAGS_AREA_WIDTH (f), 968 FRAME_X_FLAGS_AREA_WIDTH (f),
951 row->visible_height); 969 row->visible_height);
952 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); 970 if (!face->stipple)
971 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
953 } 972 }
954 973
955 /* Draw the right bitmap. */ 974 /* Draw the right bitmap. */
@@ -3029,6 +3048,8 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel)
3029 unsigned long pixel; 3048 unsigned long pixel;
3030 unsigned long background = di->relief_background; 3049 unsigned long background = di->relief_background;
3031 Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); 3050 Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f));
3051 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
3052 Display *dpy = FRAME_X_DISPLAY (f);
3032 3053
3033 xgcv.graphics_exposures = False; 3054 xgcv.graphics_exposures = False;
3034 xgcv.line_width = 1; 3055 xgcv.line_width = 1;
@@ -3041,19 +3062,19 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel)
3041 { 3062 {
3042 /* If display has an immutable color map, freeing colors is not 3063 /* If display has an immutable color map, freeing colors is not
3043 necessary and some servers don't allow it. So don't do it. */ 3064 necessary and some servers don't allow it. So don't do it. */
3044 int class = FRAME_X_DISPLAY_INFO (f)->visual->class; 3065 int class = dpyinfo->visual->class;
3045 if (class != StaticColor 3066 if (class != StaticColor
3046 && class != StaticGray 3067 && class != StaticGray
3047 && class != TrueColor) 3068 && class != TrueColor)
3048 XFreeColors (FRAME_X_DISPLAY (f), cmap, &relief->pixel, 1, 0); 3069 XFreeColors (dpy, cmap, &relief->pixel, 1, 0);
3049 relief->allocated_p = 0; 3070 relief->allocated_p = 0;
3050 } 3071 }
3051 3072
3052 /* Allocate new color. */ 3073 /* Allocate new color. */
3053 xgcv.foreground = default_pixel; 3074 xgcv.foreground = default_pixel;
3054 pixel = background; 3075 pixel = background;
3055 if (x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), cmap, &pixel, 3076 if (dpyinfo->n_planes != 1
3056 factor, delta)) 3077 && x_alloc_lighter_color (f, dpy, cmap, &pixel, factor, delta))
3057 { 3078 {
3058 relief->allocated_p = 1; 3079 relief->allocated_p = 1;
3059 xgcv.foreground = relief->pixel = pixel; 3080 xgcv.foreground = relief->pixel = pixel;
@@ -3061,13 +3082,12 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel)
3061 3082
3062 if (relief->gc == 0) 3083 if (relief->gc == 0)
3063 { 3084 {
3064 xgcv.stipple = FRAME_X_DISPLAY_INFO (f)->gray; 3085 xgcv.stipple = dpyinfo->gray;
3065 mask |= GCStipple; 3086 mask |= GCStipple;
3066 relief->gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3087 relief->gc = XCreateGC (dpy, FRAME_X_WINDOW (f), mask, &xgcv);
3067 mask, &xgcv);
3068 } 3088 }
3069 else 3089 else
3070 XChangeGC (FRAME_X_DISPLAY (f), relief->gc, mask, &xgcv); 3090 XChangeGC (dpy, relief->gc, mask, &xgcv);
3071} 3091}
3072 3092
3073 3093