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



Author: carlosg
Date: Wed May  7 23:30:58 2008
New Revision: 336
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=336&view=rev

Log:
2008-05-08  Carlos Garnacho  <carlosg gnome org>

        * plugins/media-keys/gsd-media-keys-window.c
        (gsd_media_keys_window_real_realize): New function, sets a fully
        transparent input shape, so that clicks go through the media keys
        windows. Bug #531862.
        (gsd_media_keys_window_class_init): The usual glue.


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	Wed May  7 23:30:58 2008
@@ -828,12 +828,39 @@
 }
 
 static void
+gsd_media_keys_window_real_realize (GtkWidget *widget)
+{
+        GdkBitmap *mask;
+        cairo_t *cr;
+
+        if (GTK_WIDGET_CLASS (gsd_media_keys_window_parent_class)->realize) {
+                GTK_WIDGET_CLASS (gsd_media_keys_window_parent_class)->realize (widget);
+        }
+
+        mask = gdk_pixmap_new (widget->window,
+                               widget->allocation.width,
+                               widget->allocation.height,
+                               1);
+        cr = gdk_cairo_create (mask);
+
+        cairo_set_source_rgba (cr, 1., 1., 1., 0.);
+        cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+        cairo_paint (cr);
+
+        /* make the whole window ignore events */
+        gdk_window_input_shape_combine_mask (widget->window, mask, 0, 0);
+        g_object_unref (mask);
+        cairo_destroy (cr);
+}
+
+static void
 gsd_media_keys_window_class_init (GsdMediaKeysWindowClass *klass)
 {
         GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
         widget_class->show = gsd_media_keys_window_real_show;
         widget_class->hide = gsd_media_keys_window_real_hide;
+        widget_class->realize = gsd_media_keys_window_real_realize;
 
         g_type_class_add_private (klass, sizeof (GsdMediaKeysWindowPrivate));
 }



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