[Xquartz-changes] xserver: Branch 'server-1.6-apple'

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Jan 31 01:23:04 PST 2010


 hw/xquartz/xpr/xprScreen.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit 317cb7586561c9c19d4ced6f8e144bed81a837b8
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Jan 30 14:49:02 2010 -0800

    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 at apple.com>
    (cherry picked from commit 52456c602c3cdd7d5eac677889a18fad37dfb7ae)

diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 22a727e..735b2ba 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -184,7 +184,20 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
 
     // Find all the CoreGraphics displays
     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));
+    if(!displayList)
+        FatalError("Unable to allocate memory for list of displays.\n");
     CGGetActiveDisplayList(displayCount, displayList, &displayCount);
 
     /* Get the union of all screens */


More information about the Xquartz-changes mailing list