summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-04-24 21:14:04 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-04-24 21:14:04 -0700
commitc05abf0a19b0ef0fc4ace9400a095ce2521456bc (patch)
tree3b5150a0547fe3110dfd73e6fd08d29733a18daf
parentbb3d034675b70e22e78df5554cab0ec2a3d913d0 (diff)
XQuartz: Cleaned up multi-monitor support.
-rw-r--r--hw/xquartz/xpr/xprScreen.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 10bcb04c7..22caa1c2e 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -141,20 +141,26 @@ displayAtIndex(int index)
* Return the bounds of a particular display.
*/
static CGRect
-displayScreenBounds(CGDirectDisplayID id)
+displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar)
{
CGRect frame;
frame = CGDisplayBounds(id);
+ DEBUG_LOG(" %dx%d @ (%d,%d).\n",
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
/* Remove menubar to help standard X11 window managers. */
-
- if (frame.origin.y == 0)
- {
+ if (remove_menubar && !quartzHasRoot && id == 0) {
frame.origin.y += aquaMenuBarHeight;
frame.size.height -= aquaMenuBarHeight;
}
+ DEBUG_LOG(" %dx%d @ (%d,%d).\n",
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
return frame;
}
@@ -178,8 +184,13 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
/* Get the union of all screens */
for (i = 0; i < displayCount; i++)
{
+
+ /* we can't remove the menubar from the screen - doing so
+ * would constrain the pointer to the screen, not allowing it
+ * to reach the menubar..
+ */
CGDirectDisplayID dpy = displayList[i];
- frame = displayScreenBounds(dpy);
+ frame = displayScreenBounds(dpy, FALSE);
unionRect = CGRectUnion(unionRect, frame);
}
@@ -194,17 +205,12 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
{
CGDirectDisplayID dpy = displayList[i];
- frame = displayScreenBounds(dpy);
-
- /* ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
- (int)frame.size.width, (int)frame.size.height,
- (int)frame.origin.x, (int)frame.origin.y); */
-
+ frame = displayScreenBounds(dpy, TRUE);
frame.origin.x -= unionRect.origin.x;
frame.origin.y -= unionRect.origin.y;
- /* ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
- i, (int)frame.origin.x, (int)frame.origin.y); */
+ DEBUG_LOG(" placed at X11 coordinate (%d,%d).\n",
+ (int)frame.origin.x, (int)frame.origin.y);
PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
frame.size.width, frame.size.height);
@@ -314,12 +320,14 @@ xprAddScreen(int index, ScreenPtr pScreen)
if (noPseudoramiXExtension)
{
+ ErrorF("Warning: noPseudoramiXExtension!\n");
+
CGDirectDisplayID dpy;
CGRect frame;
dpy = displayAtIndex(index);
- frame = displayScreenBounds(dpy);
+ frame = displayScreenBounds(dpy, TRUE);
dfb->x = frame.origin.x;
dfb->y = frame.origin.y;