Stop the GdkDisplay mess and let gnome-appearance-properties handle gtk+
2007-06-09 Denis Washington <denisw@svn.gnome.org> * theme-thumbnail.c: (generate_gtk_theme_thumbnail): Stop the GdkDisplay mess and let gnome-appearance-properties handle gtk+ theme changes manually instead. svn path=/trunk/; revision=7720
This commit is contained in:
parent
06639be4b8
commit
3b1d45c537
2 changed files with 12 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-06-09 Denis Washington <denisw@svn.gnome.org>
|
||||||
|
|
||||||
|
* theme-thumbnail.c: (generate_gtk_theme_thumbnail):
|
||||||
|
Stop the GdkDisplay mess and let gnome-appearance-properties handle
|
||||||
|
gtk+ theme changes manually instead.
|
||||||
|
|
||||||
2007-06-10 Jens Granseuer <jensgr@gmx.net>
|
2007-06-10 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
* gtkrc-utils.c: (gtkrc_get_details), (gtkrc_get_color_scheme):
|
* gtkrc-utils.c: (gtkrc_get_details), (gtkrc_get_color_scheme):
|
||||||
|
|
|
@ -671,10 +671,8 @@ theme_thumbnail_factory_init (int argc, char *argv[])
|
||||||
GdkPixbuf *
|
GdkPixbuf *
|
||||||
generate_gtk_theme_thumbnail (GnomeThemeInfo *info)
|
generate_gtk_theme_thumbnail (GnomeThemeInfo *info)
|
||||||
{
|
{
|
||||||
GdkDisplayManager *manager;
|
|
||||||
GdkDisplay *display, *default_display;
|
|
||||||
GdkScreen *screen;
|
|
||||||
GObject *settings;
|
GObject *settings;
|
||||||
|
gchar *current_theme = NULL;
|
||||||
GtkWidget *window, *vbox, *box, *stock_button, *checkbox, *radio;
|
GtkWidget *window, *vbox, *box, *stock_button, *checkbox, *radio;
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
GtkAllocation allocation;
|
GtkAllocation allocation;
|
||||||
|
@ -683,16 +681,10 @@ generate_gtk_theme_thumbnail (GnomeThemeInfo *info)
|
||||||
GdkPixbuf *pixbuf, *ret;
|
GdkPixbuf *pixbuf, *ret;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
|
||||||
display = gdk_display_open (gdk_get_display_arg_name ());
|
settings = G_OBJECT (gtk_settings_get_default ());
|
||||||
screen = gdk_display_get_default_screen (display);
|
g_object_get (settings, "gtk-theme-name", ¤t_theme, NULL);
|
||||||
|
|
||||||
settings = G_OBJECT (gtk_settings_get_for_screen (screen));
|
|
||||||
g_object_set (settings, "gtk-theme-name", info->name, NULL);
|
g_object_set (settings, "gtk-theme-name", info->name, NULL);
|
||||||
|
|
||||||
manager = gdk_display_manager_get ();
|
|
||||||
default_display = gdk_display_manager_get_default_display (manager);
|
|
||||||
gdk_display_manager_set_default_display (manager, display);
|
|
||||||
|
|
||||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 0);
|
vbox = gtk_vbox_new (FALSE, 0);
|
||||||
|
@ -747,8 +739,6 @@ generate_gtk_theme_thumbnail (GnomeThemeInfo *info)
|
||||||
fake_expose_widget (checkbox, pixmap, NULL);
|
fake_expose_widget (checkbox, pixmap, NULL);
|
||||||
fake_expose_widget (radio, pixmap, NULL);
|
fake_expose_widget (radio, pixmap, NULL);
|
||||||
|
|
||||||
gdk_display_flush (display);
|
|
||||||
gtk_widget_destroy (window);
|
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
|
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
|
||||||
gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, width, height);
|
gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, width, height);
|
||||||
|
@ -759,8 +749,9 @@ generate_gtk_theme_thumbnail (GnomeThemeInfo *info)
|
||||||
GDK_INTERP_BILINEAR);
|
GDK_INTERP_BILINEAR);
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
gdk_display_manager_set_default_display (manager, default_display);
|
gtk_widget_destroy (window);
|
||||||
gdk_display_close (display);
|
g_object_set (settings, "gtk-theme-name", current_theme, NULL);
|
||||||
|
g_free (current_theme);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue