Replace gdk_rgb_find_color()
Use gdk_colormap_alloc_color() instead.
This commit is contained in:
		@ -31,7 +31,6 @@
 | 
				
			|||||||
#include "gdkgc.h"
 | 
					#include "gdkgc.h"
 | 
				
			||||||
#include "gdkinternals.h"
 | 
					#include "gdkinternals.h"
 | 
				
			||||||
#include "gdkpixmap.h"
 | 
					#include "gdkpixmap.h"
 | 
				
			||||||
#include "gdkrgb.h"
 | 
					 | 
				
			||||||
#include "gdkprivate.h"
 | 
					#include "gdkprivate.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1205,7 +1204,8 @@ gdk_gc_set_rgb_fg_color (GdkGC          *gc,
 | 
				
			|||||||
    return;
 | 
					    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tmp_color = *color;
 | 
					  tmp_color = *color;
 | 
				
			||||||
  gdk_rgb_find_color (cmap, &tmp_color);
 | 
					  if (!gdk_colormap_alloc_color (cmap, &tmp_color, FALSE, TRUE))
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
  gdk_gc_set_foreground (gc, &tmp_color);
 | 
					  gdk_gc_set_foreground (gc, &tmp_color);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1237,7 +1237,8 @@ gdk_gc_set_rgb_bg_color (GdkGC          *gc,
 | 
				
			|||||||
    return;
 | 
					    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tmp_color = *color;
 | 
					  tmp_color = *color;
 | 
				
			||||||
  gdk_rgb_find_color (cmap, &tmp_color);
 | 
					  if (!gdk_colormap_alloc_color (cmap, &tmp_color, FALSE, TRUE))
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
  gdk_gc_set_background (gc, &tmp_color);
 | 
					  gdk_gc_set_background (gc, &tmp_color);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -51,7 +51,8 @@ create_window (GdkWindow *parent,
 | 
				
			|||||||
      bg->green = g_random_int_range (0, 0xffff);;
 | 
					      bg->green = g_random_int_range (0, 0xffff);;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  gdk_rgb_find_color (gtk_widget_get_colormap (darea), bg);
 | 
					  if (!gdk_colormap_alloc_color (gtk_widget_get_colormap (darea), bg, FALSE, TRUE))
 | 
				
			||||||
 | 
					    g_assert_not_reached ();
 | 
				
			||||||
  gdk_window_set_background (window, bg);
 | 
					  gdk_window_set_background (window, bg);
 | 
				
			||||||
  g_object_set_data_full (G_OBJECT (window), "color", bg, g_free);
 | 
					  g_object_set_data_full (G_OBJECT (window), "color", bg, g_free);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user