From: Dana Jansens Date: Mon, 26 May 2003 16:37:14 +0000 (+0000) Subject: watch out for prototypes when making child surfaces X-Git-Tag: gl2~120 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=b907fd45db5f53b5fb37f0c7c720b7e395cbe612;p=dana%2Fopenbox.git watch out for prototypes when making child surfaces --- diff --git a/render2/surface.c b/render2/surface.c index 003dadd3..23f2d107 100644 --- a/render2/surface.c +++ b/render2/surface.c @@ -53,6 +53,10 @@ struct RrSurface *RrSurfaceNewChild(enum RrSurfaceType type, { struct RrSurface *sur; + /* cant be a child of a prototype! */ + assert(parent->inst); + if (!parent->inst) return NULL; + sur = surface_new(type, numtex); sur->inst = parent->inst; sur->win = None; /* XXX XCreateWindow? */ @@ -102,6 +106,10 @@ struct RrSurface *RrSurfaceCopyChild(struct RrSurface *orig, { struct RrSurface *sur; + /* cant be a child of a prototype! */ + assert(parent->inst); + if (!parent->inst) return NULL; + sur = surface_copy(orig); sur->inst = parent->inst; sur->win = None; /* XXX XCreateWindow? */