Add -i to shape.c for testing ShapeInput
authorMikael Magnusson <mikachu@gmail.com>
Mon, 2 Jan 2023 19:17:01 +0000 (20:17 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Mon, 2 Jan 2023 19:19:21 +0000 (20:19 +0100)
tests/shape.c

index c3de7da3c570edee89b452cac515f52c804a5ad2..42245b1b78d043c5267fffe99f27304d37959b7d 100644 (file)
 */
 
 #include <stdio.h>
+#include <string.h>
 #include <unistd.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/extensions/shape.h>
 
-int main () {
+int main (int argc, char *argv[]) {
 
   Display   *display;
   Window     win;
@@ -47,8 +48,8 @@ int main () {
   xrect.width = w - 20;
   xrect.height = h - 20;
   XShapeCombineRectangles(display, win,
-                          ShapeBounding, 0, 0, &xrect, 1,
-                          ShapeSet, Unsorted);
+              (argc > 1 && strcmp(argv[1], "-i") == 0) ? ShapeInput : ShapeBounding,
+                          0, 0, &xrect, 1, ShapeSet, Unsorted);
 
   XSetWindowBackground(display,win,BlackPixel(display,0));