XQuartz: Flush the debug log for easier debugging
Also cleaned up formatting in xpr's eventHandler (cherry picked from commit 16861d6d4239c7f3918332ef07752f1e211afb23)
This commit is contained in:
parent
57468a696e
commit
aca75f389e
|
@ -124,7 +124,7 @@ enum {
|
||||||
#ifdef ENABLE_DEBUG_LOG
|
#ifdef ENABLE_DEBUG_LOG
|
||||||
extern FILE *debug_log_fp;
|
extern FILE *debug_log_fp;
|
||||||
#define DEBUG_LOG_NAME "x11-debug.txt"
|
#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
|
#else
|
||||||
#define DEBUG_LOG(msg, args...)
|
#define DEBUG_LOG(msg, args...)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -62,53 +62,52 @@ static const char *xprOpenGLBundle = "glxCGL.bundle";
|
||||||
* eventHandler
|
* eventHandler
|
||||||
* Callback handler for Xplugin events.
|
* Callback handler for Xplugin events.
|
||||||
*/
|
*/
|
||||||
static void
|
static void eventHandler(unsigned int type, const void *arg,
|
||||||
eventHandler(unsigned int type, const void *arg,
|
unsigned int arg_size, void *data) {
|
||||||
unsigned int arg_size, void *data)
|
|
||||||
{
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case XP_EVENT_DISPLAY_CHANGED:
|
case XP_EVENT_DISPLAY_CHANGED:
|
||||||
DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
|
DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
|
||||||
QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
|
QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XP_EVENT_WINDOW_STATE_CHANGED:
|
case XP_EVENT_WINDOW_STATE_CHANGED:
|
||||||
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED\n");
|
if (arg_size >= sizeof(xp_window_state_event)) {
|
||||||
if (arg_size >= sizeof(xp_window_state_event)) {
|
const xp_window_state_event *ws_arg = arg;
|
||||||
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,
|
QuartzMessageServerThread(kXDarwinWindowState, 2,
|
||||||
ws_arg->id, ws_arg->state);
|
ws_arg->id, ws_arg->state);
|
||||||
}
|
} else {
|
||||||
break;
|
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n");
|
||||||
|
}
|
||||||
case XP_EVENT_WINDOW_MOVED:
|
break;
|
||||||
DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
|
|
||||||
if (arg_size == sizeof(xp_window_id)) {
|
case XP_EVENT_WINDOW_MOVED:
|
||||||
xp_window_id id = * (xp_window_id *) arg;
|
DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
|
||||||
WindowPtr pWin = xprGetXWindow(id);
|
if (arg_size == sizeof(xp_window_id)) {
|
||||||
QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin);
|
xp_window_id id = * (xp_window_id *) arg;
|
||||||
}
|
WindowPtr pWin = xprGetXWindow(id);
|
||||||
break;
|
QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin);
|
||||||
|
}
|
||||||
case XP_EVENT_SURFACE_DESTROYED:
|
break;
|
||||||
DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
|
|
||||||
case XP_EVENT_SURFACE_CHANGED:
|
case XP_EVENT_SURFACE_DESTROYED:
|
||||||
DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n");
|
DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
|
||||||
if (arg_size == sizeof(xp_surface_id)) {
|
case XP_EVENT_SURFACE_CHANGED:
|
||||||
int kind;
|
DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n");
|
||||||
|
if (arg_size == sizeof(xp_surface_id)) {
|
||||||
if (type == XP_EVENT_SURFACE_DESTROYED)
|
int kind;
|
||||||
kind = AppleDRISurfaceNotifyDestroyed;
|
|
||||||
else
|
if (type == XP_EVENT_SURFACE_DESTROYED)
|
||||||
kind = AppleDRISurfaceNotifyChanged;
|
kind = AppleDRISurfaceNotifyDestroyed;
|
||||||
|
else
|
||||||
DRISurfaceNotify(*(xp_surface_id *) arg, kind);
|
kind = AppleDRISurfaceNotifyChanged;
|
||||||
}
|
|
||||||
break;
|
DRISurfaceNotify(*(xp_surface_id *) arg, kind);
|
||||||
default:
|
}
|
||||||
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n",
|
break;
|
||||||
type);
|
default:
|
||||||
|
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue