From 9685cef2dd1651a01796273632f28cac6ad4f3da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 19 Oct 2009 18:08:53 +0000 Subject: [PATCH] (x_create_toolkit_scroll_bar): Don't allocate color for pixel -1 (bug #4742). --- src/ChangeLog | 5 +++++ src/xterm.c | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b3f9d9f51cf..9519ac63d7c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-10-19 Jan Djärv + + * xterm.c (x_create_toolkit_scroll_bar): Don't allocate color for + pixel -1 (bug #4742). + 2009-10-19 Dan Nicolaescu * process.c (create_pty): Remove conditionals for no longer diff --git a/src/xterm.c b/src/xterm.c index 5a004873507..97bfd5b2292 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4633,18 +4633,26 @@ x_create_toolkit_scroll_bar (f, bar) if (f->output_data.x->scroll_bar_top_shadow_pixel == -1) { pixel = f->output_data.x->scroll_bar_background_pixel; - if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), - &pixel, 1.2, 0x8000)) - pixel = -1; - f->output_data.x->scroll_bar_top_shadow_pixel = pixel; + if (pixel != -1) + { + if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), + FRAME_X_COLORMAP (f), + &pixel, 1.2, 0x8000)) + pixel = -1; + f->output_data.x->scroll_bar_top_shadow_pixel = pixel; + } } if (f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) { pixel = f->output_data.x->scroll_bar_background_pixel; - if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), - &pixel, 0.6, 0x4000)) - pixel = -1; - f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel; + if (pixel != -1) + { + if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), + FRAME_X_COLORMAP (f), + &pixel, 0.6, 0x4000)) + pixel = -1; + f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel; + } } #ifdef XtNbeNiceToColormap @@ -10433,6 +10441,7 @@ x_term_init (display_name, xrm_option, resource_name) || !strcmp (SDATA (value), "on"))) XSynchronize (dpyinfo->display, True); } + XSynchronize (dpyinfo->display, True); { Lisp_Object value; -- 2.39.2