(x_create_toolkit_scroll_bar): Don't allocate color for
authorJan Djärv <jan.h.d@swipnet.se>
Mon, 19 Oct 2009 18:08:53 +0000 (18:08 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Mon, 19 Oct 2009 18:08:53 +0000 (18:08 +0000)
pixel -1 (bug #4742).

src/ChangeLog
src/xterm.c

index b3f9d9f..9519ac6 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-19  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * xterm.c (x_create_toolkit_scroll_bar): Don't allocate color for
+       pixel -1 (bug #4742).
+
 2009-10-19  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * process.c (create_pty): Remove conditionals for no longer
index 5a00487..97bfd5b 100644 (file)
@@ -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;