From: John Tsiombikas Date: Mon, 17 May 2021 02:58:16 +0000 (+0300) Subject: made override_redirect an envvar option (RBENCH_NO_WM) X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=retrobench;a=commitdiff_plain;h=4113e2629aa9586eacd939c302355a0871125193 made override_redirect an envvar option (RBENCH_NO_WM) --- diff --git a/src/x11/main.c b/src/x11/main.c index c1f4b87..59b1765 100644 --- a/src/x11/main.c +++ b/src/x11/main.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -28,17 +29,28 @@ static Window win, root; static GC gc; static Visual *vis; static Atom xa_wm_proto, xa_wm_delwin; +static int no_wm; static XImage *ximg; static XShmSegmentInfo shm; static int wait_putimg; static int xshm_ev_completion; + int main(int argc, char **argv) { int num_frames = 0; XEvent ev; struct timeval tv, tv0; + char *env; + + if((env = getenv("RBENCH_NO_WM"))) { + if(isdigit(env[0])) { + no_wm = atoi(env); + } else { + no_wm = 1; + } + } shm.shmid = -1; shm.shmaddr = (void*)-1; @@ -190,7 +202,7 @@ static Window create_win(int width, int height, int bpp) xattr.background_pixel = BlackPixel(dpy, scr); xattr.colormap = cmap; - xattr.override_redirect = True; + xattr.override_redirect = no_wm ? True : False; win = XCreateWindow(dpy, root, 0, 0, width, height, 0, vinf->depth, InputOutput, vis, CWColormap | CWBackPixel | CWOverrideRedirect, &xattr); if(!win) return 0;