From ed81992aeaf5b81aa9c4ee5e1491c43d7aa8862e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 10 Feb 2008 15:04:26 -0500 Subject: [PATCH] make rendertest exit cleanly when it is unmapped (iconify/desktopchange) --- render/test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/render/test.c b/render/test.c index 307e2629..05416a3f 100644 --- a/render/test.c +++ b/render/test.c @@ -44,6 +44,7 @@ gint main() Window win; RrInstance *inst; RrAppearance *look; + int done; Window root; XEvent report; @@ -67,8 +68,10 @@ gint main() inst = RrInstanceNew(ob_display, ob_screen); look = RrAppearanceNew(inst, 0); - look->surface.grad = RR_SURFACE_PYRAMID; + look->surface.grad = RR_SURFACE_SPLIT_VERTICAL; look->surface.secondary = RrColorParse(inst, "Yellow"); + look->surface.split_secondary = RrColorParse(inst, "Red"); + look->surface.split_primary = RrColorParse(inst, "Green"); look->surface.primary = RrColorParse(inst, "Blue"); look->surface.interlaced = FALSE; if (ob_display == NULL) { @@ -77,7 +80,8 @@ gint main() } RrPaint(look, win, w, h); - while (1) { + done = 0; + while (!done) { XNextEvent(ob_display, &report); switch (report.type) { case Expose: @@ -87,8 +91,10 @@ gint main() report.xconfigure.width, report.xconfigure.height); break; + case UnmapNotify: + done = 1; + break; } - } RrAppearanceFree (look);