diff options
Diffstat (limited to 'typing-break/drw-break-window.c')
-rw-r--r-- | typing-break/drw-break-window.c | 31 |
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), |