XQuartz: Flush the debug log for easier debugging
Also cleaned up formatting in xpr's eventHandler
(cherry picked from commit 16861d6d42
)
This commit is contained in:
parent
57468a696e
commit
aca75f389e
|
@ -124,7 +124,7 @@ enum {
|
|||
#ifdef ENABLE_DEBUG_LOG
|
||||
extern FILE *debug_log_fp;
|
||||
#define DEBUG_LOG_NAME "x11-debug.txt"
|
||||
#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%d: " msg, __FUNCTION__, __LINE__, ##args )
|
||||
#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
|
||||
#else
|
||||
#define DEBUG_LOG(msg, args...)
|
||||
#endif
|
||||
|
|
|
@ -62,10 +62,8 @@ static const char *xprOpenGLBundle = "glxCGL.bundle";
|
|||
* eventHandler
|
||||
* Callback handler for Xplugin events.
|
||||
*/
|
||||
static void
|
||||
eventHandler(unsigned int type, const void *arg,
|
||||
unsigned int arg_size, void *data)
|
||||
{
|
||||
static void eventHandler(unsigned int type, const void *arg,
|
||||
unsigned int arg_size, void *data) {
|
||||
switch (type) {
|
||||
case XP_EVENT_DISPLAY_CHANGED:
|
||||
DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
|
||||
|
@ -73,12 +71,14 @@ eventHandler(unsigned int type, const void *arg,
|
|||
break;
|
||||
|
||||
case XP_EVENT_WINDOW_STATE_CHANGED:
|
||||
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED\n");
|
||||
if (arg_size >= sizeof(xp_window_state_event)) {
|
||||
const xp_window_state_event *ws_arg = arg;
|
||||
|
||||
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: id=%d, state=%d\n", ws_arg->id, ws_arg->state);
|
||||
QuartzMessageServerThread(kXDarwinWindowState, 2,
|
||||
ws_arg->id, ws_arg->state);
|
||||
} else {
|
||||
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n");
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -107,8 +107,7 @@ eventHandler(unsigned int type, const void *arg,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n",
|
||||
type);
|
||||
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user