chiark / gitweb /
hostside/gui-plan: break XCopyArea calls out into own function to aid debugging ...
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 12 Dec 2010 12:07:35 +0000 (12:07 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 12 Dec 2010 12:31:40 +0000 (12:31 +0000)
hostside/gui-plan.c

index 685f475b60c29eb4a451e489aa0b7d4bb4761227..70ac75bb645bac0ba1496e1be391c016e18eea58 100644 (file)
@@ -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;