Commit 64f6d8cd authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Handle 16 colour display mode. For some reason, in this mode

2005-04-05  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
	display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
	returns 1 (but GetDeviceCaps(NUMCOLORS)	does return 16). (#143415)
parent 8b388cd3
2005-04-05 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
returns 1 (but GetDeviceCaps(NUMCOLORS) does return 16). (#143415)
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Don't force
24bpp GdkVisual on 32bpp displays. (#140706)
......
2005-04-05 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
returns 1 (but GetDeviceCaps(NUMCOLORS) does return 16). (#143415)
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Don't force
24bpp GdkVisual on 32bpp displays. (#140706)
......
2005-04-05 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
returns 1 (but GetDeviceCaps(NUMCOLORS) does return 16). (#143415)
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Don't force
24bpp GdkVisual on 32bpp displays. (#140706)
......
......@@ -97,20 +97,22 @@ _gdk_visual_init (void)
HBITMAP hbm;
const gint rastercaps = GetDeviceCaps (_gdk_display_hdc, RASTERCAPS);
const int numcolors = GetDeviceCaps (_gdk_display_hdc, NUMCOLORS);
gint bitspixel = GetDeviceCaps (_gdk_display_hdc, BITSPIXEL);
gint map_entries = 0;
system_visual = g_object_new (GDK_TYPE_VISUAL, NULL);
GDK_NOTE (COLORMAP, g_print ("BITSPIXEL=%d NUMCOLORS=%d\n",
bitspixel, numcolors));
if (rastercaps & RC_PALETTE)
{
const int sizepalette = GetDeviceCaps (_gdk_display_hdc, SIZEPALETTE);
const int numcolors = GetDeviceCaps (_gdk_display_hdc, NUMCOLORS);
gchar *max_colors = getenv ("GDK_WIN32_MAX_COLORS");
system_visual->type = GDK_VISUAL_PSEUDO_COLOR;
GDK_NOTE (COLORMAP, g_print ("BITSPIXEL=%d NUMCOLORS=%d SIZEPALETTE=%d\n",
bitspixel, numcolors, sizepalette));
GDK_NOTE (COLORMAP, g_print ("SIZEPALETTE=%d\n", sizepalette));
g_assert (sizepalette == 256);
if (max_colors != NULL)
......@@ -155,6 +157,12 @@ _gdk_visual_init (void)
else
map_entries = sizepalette;
}
else if (bitspixel == 1 && numcolors == 16)
{
bitspixel = 4;
system_visual->type = GDK_VISUAL_STATIC_COLOR;
map_entries = 16;
}
else if (bitspixel == 1)
{
system_visual->type = GDK_VISUAL_STATIC_GRAY;
......
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