Darwin: More syncing witn xorg-server-1.2-apple

This commit is contained in:
Jeremy Huddleston 2007-11-22 13:17:44 -08:00
parent 4e18c62635
commit 23596291c3
3 changed files with 49 additions and 24 deletions

View File

@ -671,6 +671,7 @@ void OsVendorInit(void)
}
#endif
}
// DEBUG_LOG("Xquartz started at %s\n", ctime(time(NULL)));
// Find the full path to the keymapping file.
if ( darwinKeymapFile ) {
@ -959,7 +960,7 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = TRUE;
RegionPtr pOldClip = NULL;
RegionPtr pOldClip = NULL, bsExposed;
#ifdef DO_SAVE_UNDERS
Bool dosave = FALSE;
#endif
@ -1015,6 +1016,12 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
if (WasViewable)
{
if (pWin->backStorage)
{
pOldClip = REGION_CREATE(pScreen, NullBox, 1);
REGION_COPY(pScreen, pOldClip, &pWin->clipList);
}
if (pWin->firstChild)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
@ -1038,6 +1045,28 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
if (pWin->backStorage &&
((pWin->backingStore == Always) || WasViewable))
{
if (!WasViewable)
pOldClip = &pWin->clipList; /* a convenient empty region */
bsExposed = (*pScreen->TranslateBackingStore)
(pWin, 0, 0, pOldClip,
pWin->drawable.x, pWin->drawable.y);
if (WasViewable)
REGION_DESTROY(pScreen, pOldClip);
if (bsExposed)
{
RegionPtr valExposed = NullRegion;
if (pWin->valdata)
valExposed = &pWin->valdata->after.exposed;
(*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
if (valExposed)
REGION_EMPTY(pScreen, valExposed);
REGION_DESTROY(pScreen, bsExposed);
}
}
if (WasViewable)
{
if (anyMarked)

View File

@ -253,7 +253,7 @@ static void QuartzUpdateScreens(void)
int x, y, width, height, sx, sy;
xEvent e;
ErrorF("QuartzUpdateScreens()\n");
DEBUG_LOG("QuartzUpdateScreens()\n");
if (noPseudoramiXExtension || screenInfo.numScreens != 1)
{
/* FIXME: if not using Xinerama, we have multiple screens, and
@ -418,6 +418,7 @@ void DarwinModeProcessEvent(
{
switch (xe->u.u.type) {
case kXDarwinControllerNotify:
DEBUG_LOG("kXDarwinControllerNotify\n");
AppleWMSendEvent(AppleWMControllerNotify,
AppleWMControllerNotifyMask,
xe->u.clientMessage.u.l.longs0,
@ -425,6 +426,7 @@ void DarwinModeProcessEvent(
break;
case kXDarwinPasteboardNotify:
DEBUG_LOG("kXDarwinPasteboardNotify\n");
AppleWMSendEvent(AppleWMPasteboardNotify,
AppleWMPasteboardNotifyMask,
xe->u.clientMessage.u.l.longs0,
@ -432,7 +434,7 @@ void DarwinModeProcessEvent(
break;
case kXDarwinActivate:
// ErrorF("kXDarwinActivate\n");
DEBUG_LOG("kXDarwinActivate\n");
QuartzShow(xe->u.keyButtonPointer.rootX,
xe->u.keyButtonPointer.rootY);
AppleWMSendEvent(AppleWMActivationNotify,
@ -441,7 +443,7 @@ void DarwinModeProcessEvent(
break;
case kXDarwinDeactivate:
// ErrorF("kXDarwinDeactivate\n");
DEBUG_LOG("kXDarwinDeactivate\n");
AppleWMSendEvent(AppleWMActivationNotify,
AppleWMActivationNotifyMask,
AppleWMIsInactive, 0);
@ -449,22 +451,23 @@ void DarwinModeProcessEvent(
break;
case kXDarwinDisplayChanged:
// ErrorF("kXDarwinDisplayChanged\n");
DEBUG_LOG("kXDarwinDisplayChanged\n");
QuartzUpdateScreens();
break;
case kXDarwinWindowState:
// ErrorF("kXDarwinWindowState\n");
DEBUG_LOG("kXDarwinWindowState\n");
RootlessNativeWindowStateChanged(xe->u.clientMessage.u.l.longs0,
xe->u.clientMessage.u.l.longs1);
break;
case kXDarwinWindowMoved:
// ErrorF("kXDarwinWindowMoved\n");
RootlessNativeWindowMoved ((WindowPtr)xe->u.clientMessage.u.l.longs0);
DEBUG_LOG("kXDarwinWindowMoved\n");
RootlessNativeWindowMoved ((WindowPtr)xe->u.clientMessage.u.l.longs0);
break;
case kXDarwinToggleFullscreen:
DEBUG_LOG("kXDarwinToggleFullscreen\n");
#ifdef DARWIN_DDX_MISSING
if (quartzEnableRootless) QuartzSetFullscreen(!quartzHasRoot);
else if (quartzHasRoot) QuartzHide();
@ -500,7 +503,7 @@ void DarwinModeProcessEvent(
break;
case kXDarwinBringAllToFront:
// ErrorF("kXDarwinBringAllToFront\n");
DEBUG_LOG("kXDarwinBringAllToFront\n");
RootlessOrderAllWindows();
break;

View File

@ -80,21 +80,14 @@ eventHandler(unsigned int type, const void *arg,
break;
case XP_EVENT_WINDOW_MOVED:
DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
if (arg_size == sizeof(xp_window_id))
{
xp_window_id id = * (xp_window_id *) arg;
WindowPtr pWin = xprGetXWindow(id);
BoxRec box;
xp_error retval = xp_get_window_bounds(id, &box);
if (retval != Success) {
ErrorF("Unable to find new bounds for window\n");
break;
}
QuartzMessageServerThread(kXDarwinWindowMoved, 3, pWin, box.x1, box.y1);
}
break;
DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
if (arg_size == sizeof(xp_window_id)) {
xp_window_id id = * (xp_window_id *) arg;
WindowPtr pWin = xprGetXWindow(id);
QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin);
}
break;
case XP_EVENT_SURFACE_DESTROYED:
DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
case XP_EVENT_SURFACE_CHANGED: