+
+ /* We need to explicitly set these to NULL to avoid assertion errors in
+ * cairo when calling this multiple times. This can happen, for example,
+ * when setting the border of a window to none and then closing it. */
+ surface->surface = NULL;
+ surface->cr = NULL;
+}
+
+/*
+ * Resize the surface to the given size.
+ *
+ */
+void draw_util_surface_set_size(surface_t *surface, int width, int height) {
+ surface->width = width;
+ surface->height = height;
+ cairo_xcb_surface_set_size(surface->surface, width, height);