Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : epplets

Dir     : e16/epplets/api


Modified Files:
        epplet.c 


Log Message:
Add some (disabled) debug stuff.

===================================================================
RCS file: /cvs/e/e16/epplets/api/epplet.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -3 -r1.143 -r1.144
--- epplet.c    18 Mar 2007 22:44:17 -0000      1.143
+++ epplet.c    18 Mar 2007 22:54:02 -0000      1.144
@@ -11,6 +11,8 @@
 
 #define DEPTH() DefaultDepth(disp, DefaultScreen(disp))
 
+#define DEBUG_EVENTS 0
+
 #define SET_HINTS_OLD  1
 #define SET_HINTS_EWM  1
 
@@ -393,6 +395,21 @@
    Pixmap              pmap, mask;
 };
 
+#if DEBUG_EVENTS
+static int
+HandleXError(Display * d, XErrorEvent * ev)
+{
+   char                buf[64];
+
+   XGetErrorText(disp, ev->error_code, buf, 63);
+   printf("*** ERROR: xid=%#lx error=%i req=%i/%i: %s\n",
+         ev->resourceid, ev->error_code,
+         ev->request_code, ev->minor_code, buf);
+
+   return 0;
+}
+#endif
+
 void
 Epplet_send_ipc(char *s)
 {
@@ -439,6 +456,12 @@
        fprintf(stderr, "Epplet Error: Cannot open display\n");
        exit(1);
      }
+#if DEBUG_EVENTS
+   XSetErrorHandler(HandleXError);
+#if DEBUG_EVENTS > 1
+   XSynchronize(disp, True);
+#endif
+#endif
 
    imlib_context_set_display(disp);
    imlib_context_set_visual(DefaultVisual(disp, DefaultScreen(disp)));



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to