Hi.
I've returned from vacations

.
About compiling xepdmgrclient for C++, I see that you both have work-around'd it already, but the correct use would be to compile xepdmgrclient.c with gcc and put the correct 'extern "C" {...};' in the .h, and include that .h from the c++ code.
Just for completeness, I've modified slightly xepdmgrclient.h to include the extern "C" part, and compiled xepdmgrtest as a C++ app as an example. Attached is xepdmgr v1.9g (no other changes).
ericshliao: for the double-refresh, the code you have shown should have avoided it. Perhaps there is a bug in xepdmgr? About the ghosting effect: the more "full refreshes" with the same image displayed you do, less ghosting; the refreshes are "full" both in window mode and in full-screen mode?