summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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));