Use RGBA by default, not just on GtkWindow

This commit is contained in:
Cody Russell
2009-11-23 08:10:36 -06:00
parent d2458cc41a
commit 170d8bf584
3 changed files with 21 additions and 13 deletions

View File

@@ -241,9 +241,29 @@ gdk_screen_get_root_window (GdkScreen *screen)
GdkColormap *
gdk_screen_get_default_colormap (GdkScreen *screen)
{
GdkScreenX11 *screen_x11;
GdkColormap *colormap;
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return GDK_SCREEN_X11 (screen)->default_colormap;
screen_x11 = GDK_SCREEN_X11 (screen);
if (!screen_x11->default_colormap)
{
if (!screen_x11->rgba_visual)
{
colormap = g_object_ref (gdk_screen_get_system_colormap (screen));
}
else
{
colormap = gdk_colormap_new (screen_x11->rgba_visual,
FALSE);
}
screen_x11->default_colormap = colormap;
}
return screen_x11->default_colormap;
}
/**

View File

@@ -426,9 +426,6 @@ _gdk_windowing_window_init (GdkScreen * screen)
g_assert (screen_x11->root_window == NULL);
gdk_screen_set_default_colormap (screen,
gdk_screen_get_system_colormap (screen));
screen_x11->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
private = (GdkWindowObject *) screen_x11->root_window;

View File

@@ -1079,15 +1079,6 @@ gtk_window_init (GtkWindow *window)
gtk_widget_show (label);
gtk_window_set_label_widget (window, label);
#if 0
colormap = _gtk_widget_peek_colormap ();
if (colormap)
gtk_widget_set_colormap (GTK_WIDGET (window), colormap);
#else
gtk_widget_set_colormap (GTK_WIDGET (window),
gdk_screen_get_rgba_colormap (gtk_widget_get_screen (GTK_WIDGET (window))));
#endif
g_object_ref_sink (window);
window->has_user_ref_count = TRUE;
toplevel_list = g_slist_prepend (toplevel_list, window);