X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Fmain.c;h=8511a93bd1f8b21811d96517b1ff8c643972699f;hb=e15fd29ed680da268d796cb7cfc7e175fd542708;hp=c1f4b8732b9b381fef4589b99cb4c5a3db17fa15;hpb=21d237fda9d909bb9588d877f244431989917af7;p=retrobench diff --git a/src/x11/main.c b/src/x11/main.c index c1f4b87..8511a93 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; @@ -126,8 +138,9 @@ int main(int argc, char **argv) redraw(); - XShmPutImage(dpy, win, gc, ximg, 0, 0, 0, 0, ximg->width, ximg->height, True); - wait_putimg = 1; + XShmPutImage(dpy, win, gc, ximg, 0, 0, 0, 0, ximg->width, ximg->height, False); + XSync(dpy, False); + /*wait_putimg = 1;*/ } } else { XNextEvent(dpy, &ev); @@ -190,7 +203,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;