XQuartz: displayScreenBounds uses quartzEnableRootless rather than !quartzHasRoot

(cherry picked from commit c883a78ef0c2e7e29437881db85d3815a89ab874)
This commit is contained in:
Jeremy Huddleston 2008-10-31 15:10:34 -07:00
parent 4e762b8aa3
commit ecd55bc859
2 changed files with 12 additions and 6 deletions

View File

@ -274,9 +274,12 @@ static void QuartzUpdateScreens(void) {
pRoot = WindowTable[pScreen->myNum]; pRoot = WindowTable[pScreen->myNum];
AppleWMSetScreenOrigin(pRoot); AppleWMSetScreenOrigin(pRoot);
pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
//pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip, PW_BACKGROUND);
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
DefineInitialRootWindow(pRoot); 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 */ /* Send an event for the root reconfigure */
e.u.u.type = ConfigureNotify; e.u.u.type = ConfigureNotify;
e.u.configureNotify.window = pRoot->drawable.id; e.u.configureNotify.window = pRoot->drawable.id;
@ -303,6 +306,9 @@ void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev,
} }
void QuartzSetFullscreen(Bool state) { void QuartzSetFullscreen(Bool state) {
DEBUG_LOG("QuartzSetFullscreen: state=%d\n", state);
if(quartzHasRoot == state) if(quartzHasRoot == state)
return; return;

View File

@ -142,7 +142,7 @@ displayAtIndex(int index)
* Return the bounds of a particular display. * Return the bounds of a particular display.
*/ */
static CGRect static CGRect
displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar) displayScreenBounds(CGDirectDisplayID id)
{ {
CGRect frame; CGRect frame;
@ -153,7 +153,7 @@ displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar)
(int)frame.origin.x, (int)frame.origin.y); (int)frame.origin.x, (int)frame.origin.y);
/* Remove menubar to help standard X11 window managers. */ /* Remove menubar to help standard X11 window managers. */
if (remove_menubar && !quartzHasRoot && if (quartzEnableRootless &&
frame.origin.x == 0 && frame.origin.y == 0) { frame.origin.x == 0 && frame.origin.y == 0) {
frame.origin.y += aquaMenuBarHeight; frame.origin.y += aquaMenuBarHeight;
frame.size.height -= aquaMenuBarHeight; frame.size.height -= aquaMenuBarHeight;
@ -186,7 +186,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
/* Get the union of all screens */ /* Get the union of all screens */
for (i = 0; i < displayCount; i++) { for (i = 0; i < displayCount; i++) {
CGDirectDisplayID dpy = displayList[i]; CGDirectDisplayID dpy = displayList[i];
frame = displayScreenBounds(dpy, TRUE); frame = displayScreenBounds(dpy);
unionRect = CGRectUnion(unionRect, frame); unionRect = CGRectUnion(unionRect, frame);
} }
@ -204,7 +204,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
{ {
CGDirectDisplayID dpy = displayList[i]; CGDirectDisplayID dpy = displayList[i];
frame = displayScreenBounds(dpy, TRUE); frame = displayScreenBounds(dpy);
frame.origin.x -= unionRect.origin.x; frame.origin.x -= unionRect.origin.x;
frame.origin.y -= unionRect.origin.y; frame.origin.y -= unionRect.origin.y;
@ -328,7 +328,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
dpy = displayAtIndex(index); dpy = displayAtIndex(index);
frame = displayScreenBounds(dpy, TRUE); frame = displayScreenBounds(dpy);
dfb->x = frame.origin.x; dfb->x = frame.origin.x;
dfb->y = frame.origin.y; dfb->y = frame.origin.y;