Commit bb0446a0 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)

Sun Dec  8 20:19:22 2002  Owen Taylor  <otaylor@redhat.com>

        Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)

        * gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
        Fix typo that caused us to always return the system
        colormap.

        * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
        a private colormap and copying the system palette
        to prevent flashing, handle colormap->size greater than
        system_colormap->size.

        * gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
        Get rid of the last remains of private->xdisplay
        in favor of using private->screen.
parent af9b53fc
Sun Dec 8 20:19:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
Fix typo that caused us to always return the system
colormap.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
a private colormap and copying the system palette
to prevent flashing, handle colormap->size greater than
system_colormap->size.
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
Get rid of the last remains of private->xdisplay
in favor of using private->screen.
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
......
Sun Dec 8 20:19:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
Fix typo that caused us to always return the system
colormap.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
a private colormap and copying the system palette
to prevent flashing, handle colormap->size greater than
system_colormap->size.
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
Get rid of the last remains of private->xdisplay
in favor of using private->screen.
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
......
Sun Dec 8 20:19:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
Fix typo that caused us to always return the system
colormap.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
a private colormap and copying the system palette
to prevent flashing, handle colormap->size greater than
system_colormap->size.
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
Get rid of the last remains of private->xdisplay
in favor of using private->screen.
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
......
Sun Dec 8 20:19:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
Fix typo that caused us to always return the system
colormap.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
a private colormap and copying the system palette
to prevent flashing, handle colormap->size greater than
system_colormap->size.
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
Get rid of the last remains of private->xdisplay
in favor of using private->screen.
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
......
Sun Dec 8 20:19:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
Fix typo that caused us to always return the system
colormap.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
a private colormap and copying the system palette
to prevent flashing, handle colormap->size greater than
system_colormap->size.
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
Get rid of the last remains of private->xdisplay
in favor of using private->screen.
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
......
Sun Dec 8 20:19:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_foreign_new):
Fix typo that caused us to always return the system
colormap.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_new): When allocating
a private colormap and copying the system palette
to prevent flashing, handle colormap->size greater than
system_colormap->size.
* gdk/x11/gdkcolor-x11.c (gdk_x11_colormap_get_xdisplay):
Get rid of the last remains of private->xdisplay
in favor of using private->screen.
2002-12-09 Tor Lillqvist <tml@iki.fi>
Merge from stable:
......
......@@ -38,7 +38,6 @@ struct _GdkColormapPrivateX11
{
GdkScreen *screen;
Colormap xcolormap;
Display *xdisplay;
gint private_val;
GHashTable *hash;
......@@ -205,18 +204,23 @@ gdk_colormap_new (GdkVisual *visual,
if (allocate)
{
GdkVisual *system_visual;
XColor *default_colors;
gint n_default_colors;
system_visual = gdk_screen_get_system_visual (private->screen);
n_default_colors = MIN (system_visual->colormap_size, colormap->size);
default_colors = g_new (XColor, colormap->size);
for (i = 0; i < colormap->size; i++)
for (i = 0; i < n_default_colors; i++)
default_colors[i].pixel = i;
XQueryColors (xdisplay,
DefaultColormapOfScreen (GDK_SCREEN_X11 (private->screen)->xscreen),
default_colors, colormap->size);
default_colors, n_default_colors);
for (i = 0; i < colormap->size; i++)
for (i = 0; i < n_default_colors; i++)
{
colormap->colors[i].pixel = default_colors[i].pixel;
colormap->colors[i].red = default_colors[i].red;
......@@ -224,7 +228,7 @@ gdk_colormap_new (GdkVisual *visual,
colormap->colors[i].blue = default_colors[i].blue;
}
gdk_colormap_change (colormap, colormap->size);
gdk_colormap_change (colormap, n_default_colors);
g_free (default_colors);
}
......@@ -1282,7 +1286,7 @@ gdk_x11_colormap_foreign_new (GdkVisual *visual,
screen = gdk_visual_get_screen (visual);
if (xcolormap == DefaultColormap (GDK_SCREEN_XDISPLAY (screen),
GDK_SCREEN_XNUMBER (screen)));
GDK_SCREEN_XNUMBER (screen)))
return g_object_ref (gdk_screen_get_system_colormap (screen));
colormap = gdk_colormap_lookup (screen, xcolormap);
......@@ -1296,7 +1300,6 @@ gdk_x11_colormap_foreign_new (GdkVisual *visual,
private->screen = screen;
private->xcolormap = xcolormap;
private->xdisplay = GDK_SCREEN_XDISPLAY (screen);
private->private_val = FALSE;
colormap->size = visual->colormap_size;
......@@ -1470,7 +1473,7 @@ gdk_x11_colormap_get_xdisplay (GdkColormap *colormap)
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
return private->xdisplay;
return GDK_SCREEN_XDISPLAY (private->screen);
}
/**
......
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