summaryrefslogtreecommitdiff
path: root/typing-break/drw-break-window.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-07-12 19:44:26 +0200
committerinfirit <[email protected]>2015-07-12 19:44:26 +0200
commit2208d0af94aeb5b68d1209ad2b11cd46c14c8d23 (patch)
tree50db1b72797858309fec008fc5fdb7f579fb9e05 /typing-break/drw-break-window.c
parentfb522992685b334c9b5e56d3eb15f9ba2d0b3acd (diff)
downloadmate-control-center-2208d0af94aeb5b68d1209ad2b11cd46c14c8d23.tar.bz2
mate-control-center-2208d0af94aeb5b68d1209ad2b11cd46c14c8d23.tar.xz
Replace Gdk drawing with Cairo
Diffstat (limited to 'typing-break/drw-break-window.c')
-rw-r--r--typing-break/drw-break-window.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index bb9edefe..87e7ec3f 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -605,7 +605,7 @@ label_expose_event_cb (GtkLabel *label,
GtkWidget *widget;
GdkWindow *window;
#if !GTK_CHECK_VERSION (3, 0, 0)
- GdkGC *gc;
+ cairo_t *cr;
#endif
color.red = 0;
@@ -618,23 +618,24 @@ label_expose_event_cb (GtkLabel *label,
widget = GTK_WIDGET (label);
window = gtk_widget_get_window (widget);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gc = gdk_gc_new (window);
- gdk_gc_set_rgb_fg_color (gc, &color);
- gdk_gc_set_clip_rectangle (gc, &event->area);
-#endif
-
#if GTK_CHECK_VERSION (3, 0, 0)
pango_cairo_show_layout (cr, gtk_label_get_layout (label));
#else
- gdk_draw_layout_with_colors (window,
- gc,
- x + 1,
- y + 1,
- gtk_label_get_layout (label),
- &color,
- NULL);
- g_object_unref (gc);
+ cr = gdk_cairo_create (window);
+
+ gdk_cairo_rectangle (cr, &event->area);
+ cairo_clip (cr);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+
+ /* Can't use pango_cairo_show_layout() here as we need to override
+ * the layout's colors with our shadow color.
+ */
+ cairo_move_to (cr, x + 1, y + 1);
+ pango_cairo_layout_path (cr, gtk_label_get_layout (label));
+ cairo_fill (cr);
+
+ cairo_destroy (cr);
#endif
gtk_paint_layout (gtk_widget_get_style (widget),