[gnome-power-manager] Update the GSD media keys window shared code to fix the build with GTK3
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] Update the GSD media keys window shared code to fix the build with GTK3
- Date: Mon, 4 Oct 2010 12:34:40 +0000 (UTC)
commit bd26843ba305ade6939698f753470b4432ec170f
Author: William Jon McCann <jmccann redhat com>
Date: Mon Oct 4 13:07:17 2010 +0100
Update the GSD media keys window shared code to fix the build with GTK3
src/gsd-media-keys-window.c | 36 +++++++++++++-----------------------
1 files changed, 13 insertions(+), 23 deletions(-)
---
diff --git a/src/gsd-media-keys-window.c b/src/gsd-media-keys-window.c
index fdc1ea1..2cdc084 100644
--- a/src/gsd-media-keys-window.c
+++ b/src/gsd-media-keys-window.c
@@ -956,36 +956,26 @@ gsd_media_keys_window_real_hide (GtkWidget *widget)
static void
gsd_media_keys_window_real_realize (GtkWidget *widget)
{
- GdkColormap *colormap;
- GtkAllocation allocation;
- GdkBitmap *mask;
- cairo_t *cr;
-
- colormap = gdk_screen_get_rgba_colormap (gtk_widget_get_screen (widget));
+ cairo_region_t *region;
+ GdkScreen *screen;
+ GdkVisual *visual;
- if (colormap != NULL) {
- gtk_widget_set_colormap (widget, colormap);
+ screen = gtk_widget_get_screen (widget);
+ visual = gdk_screen_get_rgba_visual (screen);
+ if (visual == NULL) {
+ visual = gdk_screen_get_system_visual (screen);
}
+ gtk_widget_set_visual (widget, visual);
+
if (GTK_WIDGET_CLASS (gsd_media_keys_window_parent_class)->realize) {
GTK_WIDGET_CLASS (gsd_media_keys_window_parent_class)->realize (widget);
}
- gtk_widget_get_allocation (widget, &allocation);
- mask = gdk_pixmap_new (gtk_widget_get_window (widget),
- allocation.width,
- 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 (gtk_widget_get_window (widget), mask, 0, 0);
- g_object_unref (mask);
- cairo_destroy (cr);
+ region = cairo_region_create ();
+ gtk_widget_input_shape_combine_region (widget, region);
+ cairo_region_destroy (region);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]