summaryrefslogtreecommitdiff
path: root/typing-break/drw-break-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'typing-break/drw-break-window.c')
-rw-r--r--typing-break/drw-break-window.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index 4c3484c3..87e7ec3f 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -87,7 +87,7 @@ static void label_size_request_cb (GtkLabel *label,
G_DEFINE_TYPE (DrwBreakWindow, drw_break_window, GTK_TYPE_WINDOW)
-static guint signals[LAST_SIGNAL];
+static guint signals[LAST_SIGNAL] = { 0 };
static void
drw_break_window_class_init (DrwBreakWindowClass *klass)
@@ -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),