]> Dogcows Code - chaz/openbox/commitdiff
make rendertest exit cleanly when it is unmapped (iconify/desktopchange)
authorDana Jansens <danakj@orodu.net>
Sun, 10 Feb 2008 20:04:26 +0000 (15:04 -0500)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 14 Feb 2008 18:40:01 +0000 (19:40 +0100)
render/test.c

index 307e2629838fc52f7d4ce90030e8ec1e70963b4e..05416a3fc7074ac652e34c68f0a80b45796dd173 100644 (file)
@@ -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);
This page took 0.024923 seconds and 4 git commands to generate.