From 97d677d5b989cee9b9534999ad7b4e9f95aeb578 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 18 Sep 2014 15:06:20 +0000 Subject: flicker test --- Sgraph.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sgraph.c b/Sgraph.c index 39a8a63..bd4699b 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -177,7 +177,7 @@ Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr) XtCreateWindow(w, InputOutput, CopyFromParent, *mask, attr); sw->sgraph.backBuf = XdbeAllocateBackBufferName(XtDisplay(w), - XtWindow(w), XdbeUndefined); + XtWindow(w), XdbeBackground); Resize(w); } @@ -244,6 +244,10 @@ Redisplay(Widget w, XEvent *event, Region r) 0, 0, width, height); */ + XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, + 0, height / 2, 2 * width, height / 2); + XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, + 0, height / 2 + height, 2 * width, height / 2 + height); for (x = 0; x < sw->sgraph.size; x++) { yl = sw->sgraph.leftData[x] / (2 * height) + height / 2; yr = sw->sgraph.rightData[x] / (2 * height) + height / 2; @@ -254,8 +258,12 @@ Redisplay(Widget w, XEvent *event, Region r) sw->sgraph.foreGC, x, yr); } + /* flicker test */ + XFillRectangle(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, + width / 2, 2 * height, width, 3 * height); + swap.swap_window = XtWindow(sw); - swap.swap_action = XdbeUntouched; + swap.swap_action = XdbeBackground; XdbeSwapBuffers(XtDisplay(sw), &swap, 1); } -- cgit v1.2.3