]> Pileus Git - ~andy/gtk/commitdiff
Fixes for GdkColormapX11 (#100023, Naofumi Yasufuku)
authorOwen Taylor <otaylor@redhat.com>
Mon, 9 Dec 2002 01:29:34 +0000 (01:29 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 9 Dec 2002 01:29:34 +0000 (01:29 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkcolor-x11.c

index 6d2e2433411d0454448f2ce119b3c08b8f2419a3..66fa3f7b86aa1d3eb7ee78da4812239126755a6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+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:
index 6d2e2433411d0454448f2ce119b3c08b8f2419a3..66fa3f7b86aa1d3eb7ee78da4812239126755a6e 100644 (file)
@@ -1,3 +1,20 @@
+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:
index 6d2e2433411d0454448f2ce119b3c08b8f2419a3..66fa3f7b86aa1d3eb7ee78da4812239126755a6e 100644 (file)
@@ -1,3 +1,20 @@
+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:
index 6d2e2433411d0454448f2ce119b3c08b8f2419a3..66fa3f7b86aa1d3eb7ee78da4812239126755a6e 100644 (file)
@@ -1,3 +1,20 @@
+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:
index 6d2e2433411d0454448f2ce119b3c08b8f2419a3..66fa3f7b86aa1d3eb7ee78da4812239126755a6e 100644 (file)
@@ -1,3 +1,20 @@
+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:
index 6d2e2433411d0454448f2ce119b3c08b8f2419a3..66fa3f7b86aa1d3eb7ee78da4812239126755a6e 100644 (file)
@@ -1,3 +1,20 @@
+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:
index c4e6a4b0ce9f01afec2cc6493e43ce8a388a7d92..7282d6a329e687915c1e23a0e84149b3af1aaa7d 100644 (file)
@@ -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);
 }
 
 /**