From 160847bb126a55e1760fa2fd36fad2a1288fda79 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 12 Dec 2010 12:07:35 +0000 Subject: [PATCH] hostside/gui-plan: break XCopyArea calls out into own function to aid debugging (no functional change) --- hostside/gui-plan.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/hostside/gui-plan.c b/hostside/gui-plan.c index 685f475..70ac75b 100644 --- a/hostside/gui-plan.c +++ b/hostside/gui-plan.c @@ -258,6 +258,17 @@ static void xlib_expose(XExposeEvent *ev) { } } +static void copyarea(const char *what, + Drawable src, GC gc, int src_x, int src_y, + int w, int h, int dest_x, int dest_y) { + XCALL( XCopyArea, what, + (disp, src, win, gc, src_x,src_y, w,h, dest_x,dest_y) ); +// XEvent ev; +// XSync(disp,0); +// if (XCheckTypedEvent(disp,GraphicsExpose,&ev)) +// die_graphicsexpose(&ev); +} + static void redraw(SegmovfeatState *fs) { PosnState *src; XGCValues gcv; @@ -267,17 +278,16 @@ static void redraw(SegmovfeatState *fs) { redraw_needed_count--; } src= 0; - XCALL( XCopyArea, "redraw", - (disp, bg_pixmap, win, fs->whole.gc, - fs->whole.x, fs->whole.y, - fs->whole.width, fs->whole.height, - fs->whole.x, fs->whole.y) ); + copyarea("redraw", bg_pixmap, fs->whole.gc, + fs->whole.x, fs->whole.y, + fs->whole.width, fs->whole.height, + fs->whole.x, fs->whole.y); + if (fs->flags.on) { src= &fs->posns[fs->posn][fs->flags.inv][fs->flags.det]; - XCALL( XCopyArea, "redraw", - (disp, src->pm, win, fs->whole.gc, - 0,0, src->width, src->height, - src->x, src->y) ); + copyarea("redraw-on", src->pm, fs->whole.gc, + 0,0, src->width, src->height, + src->x, src->y); } if (fs->flags.trainown && src && src->edge.x >= 0) { gcv.foreground= fs->flags.trainown>1 ? train_pixel : owned_pixel; -- 2.30.2