summaryrefslogtreecommitdiff
path: root/src/themes/nodoka/nodoka-theme.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-07-25 15:37:33 +0200
committerinfirit <[email protected]>2015-07-28 12:44:04 +0200
commit53bb2e6c7b94e0b913d35aec169e5cb669dd3984 (patch)
treec6b68de925c723f694291ffddd5e348bf0be6c4b /src/themes/nodoka/nodoka-theme.c
parent6de22307224c124f1283381a383fc97506d0c2f2 (diff)
downloadmate-notification-daemon-53bb2e6c7b94e0b913d35aec169e5cb669dd3984.tar.bz2
mate-notification-daemon-53bb2e6c7b94e0b913d35aec169e5cb669dd3984.tar.xz
nodoka: Use a cairo rectangle instead of a gdk rectangle
They are virtually the same and in Gtk3 GdkRectangle is a cairo_rectangle_int_t anyway.
Diffstat (limited to 'src/themes/nodoka/nodoka-theme.c')
-rw-r--r--src/themes/nodoka/nodoka-theme.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c
index f1a9af3..da1553c 100644
--- a/src/themes/nodoka/nodoka-theme.c
+++ b/src/themes/nodoka/nodoka-theme.c
@@ -305,7 +305,7 @@ nodoka_rounded_rectangle_with_arrow (cairo_t * cr,
cairo_translate (cr, x, y);
- GdkRectangle rect;
+ cairo_rectangle_int_t rect;
rect.x = 0;
rect.width = w;
if (arrow_up)
@@ -603,47 +603,45 @@ configure_event_cb(GtkWidget *nw,
static gboolean
countdown_expose_cb(GtkWidget *pie,
#if GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *cr,
+ cairo_t *cr,
#else
- GdkEventExpose *event,
+ GdkEventExpose *event,
#endif
- WindowData *windata)
+ WindowData *windata)
{
- cairo_t *context;
- cairo_surface_t *surface;
-
- context = gdk_cairo_create(gtk_widget_get_window(pie));
- GtkAllocation alloc;
- gtk_widget_get_allocation(pie, &alloc);
#if !GTK_CHECK_VERSION(3, 0, 0)
- cairo_t *cr;
+ cairo_t *cr = gdk_cairo_create (event->window);
#endif
+ cairo_t *cr2;
+ cairo_surface_t *surface;
+ GtkAllocation alloc;
- cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
- surface = cairo_surface_create_similar(cairo_get_target(context),
- CAIRO_CONTENT_COLOR_ALPHA,
- alloc.width,
- alloc.height);
-#if GTK_CHECK_VERSION(3, 0, 0)
- cairo_set_source_surface (cr, surface, 0, 0);
-#else
- cr = cairo_create(surface);
-#endif
+ gtk_widget_get_allocation (windata->win, &alloc);
+ surface = cairo_surface_create_similar (cairo_get_target (cr),
+ CAIRO_CONTENT_COLOR_ALPHA,
+ alloc.width,
+ alloc.height);
+ cr2 = cairo_create (surface);
- cairo_translate (cr, -alloc.x, -alloc.y);
- fill_background (pie, windata, cr);
- cairo_translate (cr, alloc.x, alloc.y);
-
- draw_pie (pie, windata, cr);
+ cairo_translate (cr2, -alloc.x, -alloc.y);
+ fill_background (pie, windata, cr2);
+ cairo_translate (cr2, alloc.x, alloc.y);
+ draw_pie (pie, windata, cr2);
+ 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);
#if !GTK_CHECK_VERSION(3, 0, 0)
- cairo_destroy(cr);
+ cairo_destroy (cr);
#endif
- cairo_set_source_surface(context, surface, 0, 0);
- cairo_paint(context);
- cairo_surface_destroy(surface);
- cairo_destroy(context);
return TRUE;
}