Commit 13087315 authored by Benjamin Otte's avatar Benjamin Otte

gdk: Don't require allocating window background colors anymore

X!! allocates the colors itself now.
parent c3a59fbf
......@@ -676,10 +676,8 @@ gdk_offscreen_window_set_background (GdkWindow *window,
const GdkColor *color)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkColormap *colormap = gdk_drawable_get_colormap (window);
private->bg_color = *color;
gdk_colormap_query_color (colormap, private->bg_color.pixel, &private->bg_color);
if (private->bg_pixmap &&
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
......
......@@ -7072,9 +7072,6 @@ gdk_window_get_background (GdkWindow *window,
* you're an application - or gtk_style_set_background() - if you're
* implementing a custom widget.)
*
* The @color must be allocated; gdk_rgb_find_color() is the best way
* to allocate a color.
*
* See also gdk_window_set_background_pixmap().
*/
void
......@@ -7082,7 +7079,6 @@ gdk_window_set_background (GdkWindow *window,
const GdkColor *color)
{
GdkWindowObject *private;
GdkColormap *colormap = gdk_drawable_get_colormap (window);
GdkWindowImplIface *impl_iface;
g_return_if_fail (GDK_IS_WINDOW (window));
......@@ -7090,7 +7086,6 @@ gdk_window_set_background (GdkWindow *window,
private = (GdkWindowObject *) window;
private->bg_color = *color;
gdk_colormap_query_color (colormap, private->bg_color.pixel, &private->bg_color);
if (private->bg_pixmap &&
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
......
......@@ -2637,8 +2637,17 @@ static void
gdk_window_x11_set_background (GdkWindow *window,
const GdkColor *color)
{
GdkColor allocated = *color;
if (!gdk_colormap_alloc_color (gdk_drawable_get_colormap (window),
&allocated,
TRUE, TRUE))
return;
XSetWindowBackground (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), color->pixel);
GDK_WINDOW_XID (window), allocated.pixel);
gdk_colormap_free_colors (gdk_drawable_get_colormap (window), &allocated, 1);
}
static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment