gnome-settings-daemon r503 - in trunk: . plugins/media-keys



Author: jensg
Date: Thu Sep 11 17:27:11 2008
New Revision: 503
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=503&view=rev

Log:
2008-09-11  Jens Granseuer  <jensgr gmx net>

	Make the volume popup not crash when invoking it on any screen but the
	first when using a compositing manager (bug #551677)

	* plugins/media-keys/gsd-media-keys-window.c:
	(gsd_media_keys_window_real_realize), (gsd_media_keys_window_init):
	do not set the window colormap at init time where we'll only use the
	colormap of the default screen. Instead, whenever the window is
	realized, update the colormap to match the current screen.


Modified:
   trunk/ChangeLog
   trunk/plugins/media-keys/gsd-media-keys-window.c

Modified: trunk/plugins/media-keys/gsd-media-keys-window.c
==============================================================================
--- trunk/plugins/media-keys/gsd-media-keys-window.c	(original)
+++ trunk/plugins/media-keys/gsd-media-keys-window.c	Thu Sep 11 17:27:11 2008
@@ -830,9 +830,16 @@
 static void
 gsd_media_keys_window_real_realize (GtkWidget *widget)
 {
+        GdkColormap *colormap;
         GdkBitmap *mask;
         cairo_t *cr;
 
+        colormap = gdk_screen_get_rgba_colormap (gtk_widget_get_screen (widget));
+
+        if (colormap != NULL) {
+                gtk_widget_set_colormap (widget, colormap);
+        }
+
         if (GTK_WIDGET_CLASS (gsd_media_keys_window_parent_class)->realize) {
                 GTK_WIDGET_CLASS (gsd_media_keys_window_parent_class)->realize (widget);
         }
@@ -873,23 +880,6 @@
 }
 
 static void
-initialize_alpha_mode (GsdMediaKeysWindow *window, GdkScreen *screen)
-{
-        GdkColormap *colormap = NULL;
-
-        if (gdk_screen_is_composited (screen)) {
-                colormap = gdk_screen_get_rgba_colormap (screen);
-        }
-
-        if (colormap != NULL) {
-                gtk_widget_set_colormap (GTK_WIDGET (window), colormap);
-                window->priv->is_composited = TRUE;
-        } else {
-                window->priv->is_composited = FALSE;
-        }
-}
-
-static void
 gsd_media_keys_window_init (GsdMediaKeysWindow *window)
 {
         GdkScreen *screen;
@@ -898,7 +888,7 @@
 
         screen = gtk_widget_get_screen (GTK_WIDGET (window));
 
-        initialize_alpha_mode (window, screen);
+        window->priv->is_composited = gdk_screen_is_composited (screen);
 
         if (window->priv->is_composited) {
                 gdouble scalew, scaleh, scale;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]