+ if (a->surface.parentx < 0 || a->surface.parenty < 0) {
+ /* ob_debug("Invalid parent co-ordinates\n"); */
+ return None;
+ }
+
+ if (a->surface.grad == RR_SURFACE_PARENTREL &&
+ (a->surface.parentx >= a->surface.parent->w ||
+ a->surface.parenty >= a->surface.parent->h))
+ {
+ return None;
+ }
+
+ resized = (a->w != w || a->h != h);
+
+ oldp = a->pixmap; /* save to free after changing the visible pixmap */
+ a->pixmap = XCreatePixmap(RrDisplay(a->inst),
+ RrRootWindow(a->inst),
+ w, h, RrDepth(a->inst));
+
+ g_assert(a->pixmap != None);
+ a->w = w;
+ a->h = h;
+
+ if (a->xftdraw != NULL)
+ XftDrawDestroy(a->xftdraw);
+ a->xftdraw = XftDrawCreate(RrDisplay(a->inst), a->pixmap,
+ RrVisual(a->inst), RrColormap(a->inst));
+ g_assert(a->xftdraw != NULL);
+
+ if (resized) {
+ g_free(a->surface.pixel_data);
+ a->surface.pixel_data = g_new(RrPixel32, w * h);
+ }