XQuartz: More debugging spew for tracking down the NewCurrentScreen crash.

This commit is contained in:
Jeremy Huddleston 2008-08-30 14:55:36 -07:00
parent 61d140c66c
commit 4b7c684371
3 changed files with 18 additions and 2 deletions

View File

@ -2623,7 +2623,12 @@ ProcWarpPointer(ClientPtr client)
}
else if (!PointerConfinedToScreen())
{
NewCurrentScreen(newScreen, x, y);
#ifdef XQUARTZ
/* XQuartz is sometimes crashing in NewCurrentScreen with pScreen==NULL, putting some debugging here to maybe catch the culprit */
if(newScreen == NULL)
ErrorF("ProcWarpPointer: newScreen=%p dest=%p\n", newScreen, dest);
#endif
NewCurrentScreen(newScreen, x, y);
}
return Success;
}

View File

@ -212,9 +212,15 @@ mieqProcessInputEvents(void)
#endif
e = &miEventQueue.events[miEventQueue.head];
/* Assumption - screen switching can only occur on motion events. */
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
#ifdef XQUARTZ
/* XQuartz is sometimes crashing in NewCurrentScreen with pScreen==NULL, putting some debugging here to maybe catch the culprit */
if(miEventQueue.pDequeueScreen==NULL || e->pScreen == NULL)
ErrorF("miPointerSetScreen: miEventQueue.pDequeueScreen=%p, e->pScreen=%p, event type=%d\n", miEventQueue.pDequeueScreen, e->pScreen, e->event->u.u.type);
#endif
/* Assumption - screen switching can only occur on motion events. */
if (e->pScreen != miEventQueue.pDequeueScreen) {
miEventQueue.pDequeueScreen = e->pScreen;
x = e->event[0].u.keyButtonPointer.rootX;

View File

@ -378,6 +378,11 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
pScreen = screenInfo.screens[screen_no];
pScreenPriv = GetScreenPrivate (pScreen);
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, FALSE);
#ifdef XQUARTZ
/* XQuartz is sometimes crashing in NewCurrentScreen with pScreen==NULL, putting some debugging here to maybe catch the culprit */
if(pScreen == NULL)
ErrorF("miPointerSetScreen: NewCurrentScreen(%p, %d, %d)\n", pScreen, x, y);
#endif
NewCurrentScreen (pScreen, x, y);
miPointer.limits.x2 = pScreen->width;
miPointer.limits.y2 = pScreen->height;