XQuartz: Cleaned up multi-monitor support.
This commit is contained in:
parent
bb3d034675
commit
c05abf0a19
@ -141,20 +141,26 @@ displayAtIndex(int index)
|
|||||||
* Return the bounds of a particular display.
|
* Return the bounds of a particular display.
|
||||||
*/
|
*/
|
||||||
static CGRect
|
static CGRect
|
||||||
displayScreenBounds(CGDirectDisplayID id)
|
displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar)
|
||||||
{
|
{
|
||||||
CGRect frame;
|
CGRect frame;
|
||||||
|
|
||||||
frame = CGDisplayBounds(id);
|
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. */
|
/* Remove menubar to help standard X11 window managers. */
|
||||||
|
if (remove_menubar && !quartzHasRoot && id == 0) {
|
||||||
if (frame.origin.y == 0)
|
|
||||||
{
|
|
||||||
frame.origin.y += aquaMenuBarHeight;
|
frame.origin.y += aquaMenuBarHeight;
|
||||||
frame.size.height -= 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;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,8 +184,13 @@ 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++)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/* 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];
|
CGDirectDisplayID dpy = displayList[i];
|
||||||
frame = displayScreenBounds(dpy);
|
frame = displayScreenBounds(dpy, FALSE);
|
||||||
unionRect = CGRectUnion(unionRect, frame);
|
unionRect = CGRectUnion(unionRect, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,17 +205,12 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
|
|||||||
{
|
{
|
||||||
CGDirectDisplayID dpy = displayList[i];
|
CGDirectDisplayID dpy = displayList[i];
|
||||||
|
|
||||||
frame = displayScreenBounds(dpy);
|
frame = displayScreenBounds(dpy, TRUE);
|
||||||
|
|
||||||
/* 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.origin.x -= unionRect.origin.x;
|
frame.origin.x -= unionRect.origin.x;
|
||||||
frame.origin.y -= unionRect.origin.y;
|
frame.origin.y -= unionRect.origin.y;
|
||||||
|
|
||||||
/* ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
|
DEBUG_LOG(" placed at X11 coordinate (%d,%d).\n",
|
||||||
i, (int)frame.origin.x, (int)frame.origin.y); */
|
(int)frame.origin.x, (int)frame.origin.y);
|
||||||
|
|
||||||
PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
|
PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
|
||||||
frame.size.width, frame.size.height);
|
frame.size.width, frame.size.height);
|
||||||
@ -314,12 +320,14 @@ xprAddScreen(int index, ScreenPtr pScreen)
|
|||||||
|
|
||||||
if (noPseudoramiXExtension)
|
if (noPseudoramiXExtension)
|
||||||
{
|
{
|
||||||
|
ErrorF("Warning: noPseudoramiXExtension!\n");
|
||||||
|
|
||||||
CGDirectDisplayID dpy;
|
CGDirectDisplayID dpy;
|
||||||
CGRect frame;
|
CGRect frame;
|
||||||
|
|
||||||
dpy = displayAtIndex(index);
|
dpy = displayAtIndex(index);
|
||||||
|
|
||||||
frame = displayScreenBounds(dpy);
|
frame = displayScreenBounds(dpy, TRUE);
|
||||||
|
|
||||||
dfb->x = frame.origin.x;
|
dfb->x = frame.origin.x;
|
||||||
dfb->y = frame.origin.y;
|
dfb->y = frame.origin.y;
|
||||||
|
Loading…
Reference in New Issue
Block a user