summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremy@tifa.local>2007-11-22 13:17:44 -0800
committerJeremy Huddleston <jeremy@tifa.local>2007-11-22 13:17:44 -0800
commit23596291c30a85e38c00aef2c01b46d561e2916e (patch)
treea6973e64252c96ef0143d94e6c3957b3095b0d5d /hw
parent4e18c626350c7c2e0fb540aa64a98957699f3abe (diff)
Darwin: More syncing witn xorg-server-1.2-apple
Diffstat (limited to 'hw')
-rw-r--r--hw/darwin/darwin.c31
-rw-r--r--hw/darwin/quartz/quartz.c19
-rw-r--r--hw/darwin/quartz/xpr/xprScreen.c23
3 files changed, 49 insertions, 24 deletions
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index a772218fe..b08770c10 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -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)
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index 23707a071..c95880ceb 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -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;
diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c
index aff190155..1b6addc49 100644
--- a/hw/darwin/quartz/xpr/xprScreen.c
+++ b/hw/darwin/quartz/xpr/xprScreen.c
@@ -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: