XQuartz: Attatch a stub display when CoreGraphics reports no displays.
This is half of the required changes to address the "stuck mouse pointer" bug that occurs when X11 launches while the displays are asleep. The remainder of the fix is part of libXplugin which needs to be updated to send XP_EVENT_DISPLAY_CHANGED when the display wakes up. If you don't have a recent enough libXplugin (expected in 2.5.0_beta2 or later), you can cause this event to be sent by changing your display resolution (or you could just start X11.app with your screens awake). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
15f4bb6dc6
commit
52456c602c
|
@ -184,7 +184,20 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
|
||||||
|
|
||||||
// Find all the CoreGraphics displays
|
// Find all the CoreGraphics displays
|
||||||
CGGetActiveDisplayList(0, NULL, &displayCount);
|
CGGetActiveDisplayList(0, NULL, &displayCount);
|
||||||
|
DEBUG_LOG("displayCount: %d\n", (int)displayCount);
|
||||||
|
|
||||||
|
if(!displayCount) {
|
||||||
|
ErrorF("CoreGraphics has reported no connected displays. Creating a stub 800x600 display.\n");
|
||||||
|
*x = *y = 0;
|
||||||
|
*width = 800;
|
||||||
|
*height = 600;
|
||||||
|
PseudoramiXAddScreen(*x, *y, *width, *height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
|
displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
|
||||||
|
if(!displayList)
|
||||||
|
FatalError("Unable to allocate memory for list of displays.\n");
|
||||||
CGGetActiveDisplayList(displayCount, displayList, &displayCount);
|
CGGetActiveDisplayList(displayCount, displayList, &displayCount);
|
||||||
|
|
||||||
/* Get the union of all screens */
|
/* Get the union of all screens */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user