chiark / gitweb /
hostside/gui-plan: special die handler for GrapicsExpose events (no change other...
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 12 Dec 2010 12:06:55 +0000 (12:06 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 12 Dec 2010 12:10:16 +0000 (12:10 +0000)
hostside/gui-plan.c

index a25f071a3f167dcb891fb8f31b045bac2299ad97..685f475b60c29eb4a451e489aa0b7d4bb4761227 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <X11/Xlib.h>
 #include <X11/xpm.h>
+#include <X11/Xproto.h>
 
 typedef int ErrorCode;
 
@@ -119,6 +120,21 @@ static void diexpm(const char *fn, const char *w, int xpmst) {
       diexpm(#f, (w), xpmcall_xpmst);          \
   }while(0)
 
+static void die_graphicsexpose(const XEvent *ev) {
+  die("GraphicsExpose %lx(%s) x=%d y=%d w=%d h=%d count=%d"
+      " major=%d(%s)",
+      (unsigned long)ev->xgraphicsexpose.drawable,
+      ev->xgraphicsexpose.drawable==win ? "w" : "?",
+      ev->xgraphicsexpose.x,
+      ev->xgraphicsexpose.y,
+      ev->xgraphicsexpose.width,
+      ev->xgraphicsexpose.height,
+      ev->xgraphicsexpose.count,
+      ev->xgraphicsexpose.major_code,
+      ev->xgraphicsexpose.major_code==X_CopyArea ? "CA" :
+      ev->xgraphicsexpose.major_code==X_CopyPlane ? "CP" : "?");
+}
+
 /*---------- input handling ----------*/
 
 typedef struct {
@@ -305,6 +321,7 @@ static void xlib_process(void) {
     switch (ev.type) {
     case Expose: xlib_expose(&ev.xexpose); break;
     case NoExpose: break;
+    case GraphicsExpose: die_graphicsexpose(&ev);
     default: die("unrequested event type %d\n",ev.type);
     }
   }