From ecd55bc859eb5d7c639d5a6d531d9df524124247 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 31 Oct 2008 15:10:34 -0700 Subject: [PATCH] XQuartz: displayScreenBounds uses quartzEnableRootless rather than !quartzHasRoot (cherry picked from commit c883a78ef0c2e7e29437881db85d3815a89ab874) --- hw/xquartz/quartz.c | 8 +++++++- hw/xquartz/xpr/xprScreen.c | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 2e4aad51d..077c87c81 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -274,9 +274,12 @@ static void QuartzUpdateScreens(void) { pRoot = WindowTable[pScreen->myNum]; AppleWMSetScreenOrigin(pRoot); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); + //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip, PW_BACKGROUND); miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); DefineInitialRootWindow(pRoot); - + + DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y); + /* Send an event for the root reconfigure */ e.u.u.type = ConfigureNotify; e.u.configureNotify.window = pRoot->drawable.id; @@ -303,6 +306,9 @@ void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, } void QuartzSetFullscreen(Bool state) { + + DEBUG_LOG("QuartzSetFullscreen: state=%d\n", state); + if(quartzHasRoot == state) return; diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c index 6f8cc302a..b37a1d9f1 100644 --- a/hw/xquartz/xpr/xprScreen.c +++ b/hw/xquartz/xpr/xprScreen.c @@ -142,7 +142,7 @@ displayAtIndex(int index) * Return the bounds of a particular display. */ static CGRect -displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar) +displayScreenBounds(CGDirectDisplayID id) { CGRect frame; @@ -153,7 +153,7 @@ displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar) (int)frame.origin.x, (int)frame.origin.y); /* Remove menubar to help standard X11 window managers. */ - if (remove_menubar && !quartzHasRoot && + if (quartzEnableRootless && frame.origin.x == 0 && frame.origin.y == 0) { frame.origin.y += aquaMenuBarHeight; frame.size.height -= aquaMenuBarHeight; @@ -186,7 +186,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) /* Get the union of all screens */ for (i = 0; i < displayCount; i++) { CGDirectDisplayID dpy = displayList[i]; - frame = displayScreenBounds(dpy, TRUE); + frame = displayScreenBounds(dpy); unionRect = CGRectUnion(unionRect, frame); } @@ -204,7 +204,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height) { CGDirectDisplayID dpy = displayList[i]; - frame = displayScreenBounds(dpy, TRUE); + frame = displayScreenBounds(dpy); frame.origin.x -= unionRect.origin.x; frame.origin.y -= unionRect.origin.y; @@ -328,7 +328,7 @@ xprAddScreen(int index, ScreenPtr pScreen) dpy = displayAtIndex(index); - frame = displayScreenBounds(dpy, TRUE); + frame = displayScreenBounds(dpy); dfb->x = frame.origin.x; dfb->y = frame.origin.y;