summaryrefslogtreecommitdiff
path: root/src/themes/nodoka
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-07-22 17:19:21 +0200
committerinfirit <[email protected]>2015-07-22 17:58:34 +0200
commit81c9996cddb0214faaf69fc0239311ef6437929e (patch)
treea1cdc941d0e33d80f8449e35c715c87ba6ee379e /src/themes/nodoka
parentf964e1d5114fef3259cf420e57687838d7fad976 (diff)
downloadmate-notification-daemon-81c9996cddb0214faaf69fc0239311ef6437929e.tar.bz2
mate-notification-daemon-81c9996cddb0214faaf69fc0239311ef6437929e.tar.xz
nodoka: Drop GdkPixmap usage for cairo in Gtk2
Diffstat (limited to 'src/themes/nodoka')
-rw-r--r--src/themes/nodoka/nodoka-theme.c47
1 files changed, 11 insertions, 36 deletions
diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c
index 07774d1..b7f3964 100644
--- a/src/themes/nodoka/nodoka-theme.c
+++ b/src/themes/nodoka/nodoka-theme.c
@@ -511,14 +511,12 @@ paint_window(GtkWidget *widget,
cairo_t *context;
cairo_surface_t *surface;
GtkAllocation alloc;
- gtk_widget_get_allocation(windata->win, &alloc);
-#if GTK_CHECK_VERSION(3, 0, 0)
- cairo_t *cr2;
-#else
- cairo_t *cr;
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ cairo_t *cr = gdk_cairo_create (event->window);
#endif
if (windata->width == 0) {
+ gtk_widget_get_allocation(windata->win, &alloc);
windata->width = alloc.width;
windata->height = alloc.height;
}
@@ -528,57 +526,34 @@ paint_window(GtkWidget *widget,
if (!(windata->enable_transparency))
{
-#if GTK_CHECK_VERSION (3, 0, 0)
surface = cairo_surface_create_similar (cairo_get_target (cr),
CAIRO_CONTENT_COLOR_ALPHA,
windata->width,
windata->height);
-/*
- cr2 = cairo_create (surface);
- / * transparent background * /
- cairo_rectangle (cr2, 0, 0, windata->width, windata->height);
- cairo_set_source_rgba (cr2, 0.0, 0.0, 0.0, 0.0);
- cairo_fill (cr2);
- cairo_destroy (cr2);
-*/
-
cairo_save (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_surface (cr, surface, 0, 0);
cairo_paint (cr);
- cairo_restore (cr);
- cairo_surface_destroy(surface);
-#else
- GdkPixmap *mask;
- cairo_t *mask_cr;
- mask = gdk_pixmap_new (NULL, windata->width,
- windata->height, 1);
- mask_cr = gdk_cairo_create ((GdkDrawable *) mask);
- cairo_set_operator (mask_cr, CAIRO_OPERATOR_CLEAR);
- cairo_paint (mask_cr);
-
- cairo_set_operator (mask_cr, CAIRO_OPERATOR_OVER);
- cairo_set_source_rgba (mask_cr, 1, 1, 1, 1);
+
+ cairo_set_source_rgba (cr, 1, 1, 1, 1);
if (windata->arrow.has_arrow)
{
- nodoka_rounded_rectangle_with_arrow (mask_cr, 0, 0,
+ nodoka_rounded_rectangle_with_arrow (cr, 0, 0,
windata->width,
windata->height,
6,
& (windata->arrow));
}
else
- nodoka_rounded_rectangle (mask_cr, 0, 0,
+ nodoka_rounded_rectangle (cr, 0, 0,
windata->width,
windata->height,
6);
- cairo_fill (mask_cr);
- gdk_window_shape_combine_mask (windata->win->window,
- (GdkBitmap *) mask, 0,0);
- gdk_pixmap_unref (mask);
- cairo_destroy (mask_cr);
-#endif
+ cairo_fill (cr);
+
+ cairo_restore (cr);
+ cairo_surface_destroy(surface);
}
context = gdk_cairo_create(gtk_widget_get_window(widget));