Fill lookup arrays _after_ possibly changing the selected visuals. (Fixes

Tue May 19 23:38:36 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
	arrays _after_ possibly changing the selected visuals.
	(Fixes problem with reversed red and blue on SGI's)
This commit is contained in:
Owen Taylor
1998-05-20 03:45:53 +00:00
committed by Owen Taylor
parent f25b333e33
commit d5e1327f9e
8 changed files with 64 additions and 23 deletions

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -1,3 +1,9 @@
Tue May 19 23:38:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkpreview.c (gtk_preview_get_visuals): Fill lookup
arrays _after_ possibly changing the selected visuals.
(Fixes problem with reversed red and blue on SGI's)
Mon May 18 22:26:33 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_window_style_set_event): Added a

View File

@@ -842,29 +842,7 @@ gtk_preview_get_visuals (GtkPreviewClass *klass)
if (!klass->info.visual)
for (i = 0; i < nvisual_types; i++)
if ((klass->info.visual = gdk_visual_get_best_with_both (depths[i], types[i])))
{
if ((klass->info.visual->type == GDK_VISUAL_TRUE_COLOR) ||
(klass->info.visual->type == GDK_VISUAL_DIRECT_COLOR))
{
klass->info.lookup_red = g_new (gulong, 256);
klass->info.lookup_green = g_new (gulong, 256);
klass->info.lookup_blue = g_new (gulong, 256);
gtk_fill_lookup_array (klass->info.lookup_red,
klass->info.visual->depth,
klass->info.visual->red_shift,
8 - klass->info.visual->red_prec);
gtk_fill_lookup_array (klass->info.lookup_green,
klass->info.visual->depth,
klass->info.visual->green_shift,
8 - klass->info.visual->green_prec);
gtk_fill_lookup_array (klass->info.lookup_blue,
klass->info.visual->depth,
klass->info.visual->blue_shift,
8 - klass->info.visual->blue_prec);
}
break;
}
break;
if (!klass->info.visual)
{
@@ -884,6 +862,27 @@ gtk_preview_get_visuals (GtkPreviewClass *klass)
klass->info.visual = gdk_visual_get_system();
}
if ((klass->info.visual->type == GDK_VISUAL_TRUE_COLOR) ||
(klass->info.visual->type == GDK_VISUAL_DIRECT_COLOR))
{
klass->info.lookup_red = g_new (gulong, 256);
klass->info.lookup_green = g_new (gulong, 256);
klass->info.lookup_blue = g_new (gulong, 256);
gtk_fill_lookup_array (klass->info.lookup_red,
klass->info.visual->depth,
klass->info.visual->red_shift,
8 - klass->info.visual->red_prec);
gtk_fill_lookup_array (klass->info.lookup_green,
klass->info.visual->depth,
klass->info.visual->green_shift,
8 - klass->info.visual->green_prec);
gtk_fill_lookup_array (klass->info.lookup_blue,
klass->info.visual->depth,
klass->info.visual->blue_shift,
8 - klass->info.visual->blue_prec);
}
switch (klass->info.visual->depth)
{
case 8: