+#ifdef DRAW_DEFAULT_CAIRO
+static void askpass_redraw_cairo(cairo_t *cr, struct drawing_area_ctx *ctx)
+{
+ cairo_set_source_rgb(cr, 1-ctx->current, 1-ctx->current, 1-ctx->current);
+ cairo_paint(cr);
+}
+#else
+static void askpass_redraw_gdk(GdkWindow *win, struct drawing_area_ctx *ctx)
+{
+ GdkGC *gc = gdk_gc_new(win);
+ gdk_gc_set_foreground(gc, &ctx->cols[ctx->current]);
+ gdk_draw_rectangle(win, gc, TRUE, 0, 0, ctx->width, ctx->height);
+ gdk_gc_unref(gc);
+}
+#endif
+
+#if GTK_CHECK_VERSION(3,0,0)
+static gint draw_area(GtkWidget *widget, cairo_t *cr, gpointer data)
+{
+ struct drawing_area_ctx *ctx = (struct drawing_area_ctx *)data;
+ askpass_redraw_cairo(cr, ctx);
+ return TRUE;
+}
+#else