aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-10-29 09:55:25 +0400
committerDmitry Antipov2013-10-29 09:55:25 +0400
commit0085b9be229be7369300f4f4ab27a9699db641b4 (patch)
treec9f11e1b06eaa030b0a0ebacbaf38f5eef6c5d77 /src/xterm.c
parentb9bef71fd33a3789b2a67a19745f6bbf8f4aff6e (diff)
downloademacs-0085b9be229be7369300f4f4ab27a9699db641b4.tar.gz
emacs-0085b9be229be7369300f4f4ab27a9699db641b4.zip
* xterm.h (struct x_output): For 'black_relief' and 'white_relief'
fields, drop 'allocated_p' member and use -1 for uninitialized value. * w32term.h (struct w32_output): Similarly but do not use -1 because... * xfaces.c (unload_color) [HAVE_X_WINDOWS]: ...this function is a no-op on MS-Windows anyway. (free_face_colors): Define only if HAVE_X_WINDOWS and... (free_realized_face): ...adjust user. * xfns.c (Fx_create_frame, x_create_tip_frame): Initialize black and white relief pixels to -1. * xterm.c (x_setup_relief_color, x_free_frame_resources): Adjust users. * w32term.c (w32_setup_relief_color, x_free_frame_resources): Likewise. * dispextern.h (unload_color): Move prototype under HAVE_X_WINDOWS.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 26ad5267625..c7fe9ec6ac8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1774,11 +1774,10 @@ x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int
1774 /* Free previously allocated color. The color cell will be reused 1774 /* Free previously allocated color. The color cell will be reused
1775 when it has been freed as many times as it was allocated, so this 1775 when it has been freed as many times as it was allocated, so this
1776 doesn't affect faces using the same colors. */ 1776 doesn't affect faces using the same colors. */
1777 if (relief->gc 1777 if (relief->gc && relief->pixel != -1)
1778 && relief->allocated_p)
1779 { 1778 {
1780 x_free_colors (f, &relief->pixel, 1); 1779 x_free_colors (f, &relief->pixel, 1);
1781 relief->allocated_p = 0; 1780 relief->pixel = -1;
1782 } 1781 }
1783 1782
1784 /* Allocate new color. */ 1783 /* Allocate new color. */
@@ -1786,10 +1785,7 @@ x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int
1786 pixel = background; 1785 pixel = background;
1787 if (dpyinfo->n_planes != 1 1786 if (dpyinfo->n_planes != 1
1788 && x_alloc_lighter_color (f, dpy, cmap, &pixel, factor, delta)) 1787 && x_alloc_lighter_color (f, dpy, cmap, &pixel, factor, delta))
1789 { 1788 xgcv.foreground = relief->pixel = pixel;
1790 relief->allocated_p = 1;
1791 xgcv.foreground = relief->pixel = pixel;
1792 }
1793 1789
1794 if (relief->gc == 0) 1790 if (relief->gc == 0)
1795 { 1791 {
@@ -9338,9 +9334,9 @@ x_free_frame_resources (struct frame *f)
9338 if (f->output_data.x->scroll_bar_bottom_shadow_pixel != -1) 9334 if (f->output_data.x->scroll_bar_bottom_shadow_pixel != -1)
9339 unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel); 9335 unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel);
9340#endif /* USE_TOOLKIT_SCROLL_BARS */ 9336#endif /* USE_TOOLKIT_SCROLL_BARS */
9341 if (f->output_data.x->white_relief.allocated_p) 9337 if (f->output_data.x->white_relief.pixel != -1)
9342 unload_color (f, f->output_data.x->white_relief.pixel); 9338 unload_color (f, f->output_data.x->white_relief.pixel);
9343 if (f->output_data.x->black_relief.allocated_p) 9339 if (f->output_data.x->black_relief.pixel != -1)
9344 unload_color (f, f->output_data.x->black_relief.pixel); 9340 unload_color (f, f->output_data.x->black_relief.pixel);
9345 9341
9346 x_free_gcs (f); 9342 x_free_gcs (f);