aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/xpr
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xquartz/xpr')
-rw-r--r--xorg-server/hw/xquartz/xpr/xprAppleWM.c2
-rw-r--r--xorg-server/hw/xquartz/xpr/xprFrame.c4
-rw-r--r--xorg-server/hw/xquartz/xpr/xprScreen.c34
3 files changed, 39 insertions, 1 deletions
diff --git a/xorg-server/hw/xquartz/xpr/xprAppleWM.c b/xorg-server/hw/xquartz/xpr/xprAppleWM.c
index 59ce6375e..1e99a07dc 100644
--- a/xorg-server/hw/xquartz/xpr/xprAppleWM.c
+++ b/xorg-server/hw/xquartz/xpr/xprAppleWM.c
@@ -69,6 +69,8 @@ static int xprSetWindowLevel(
if(XQuartzIsRootless)
wc.window_level = normal_window_levels[level];
+ else if(XQuartzShieldingWindowLevel)
+ wc.window_level = XQuartzShieldingWindowLevel + 1;
else
wc.window_level = rooted_window_levels[level];
diff --git a/xorg-server/hw/xquartz/xpr/xprFrame.c b/xorg-server/hw/xquartz/xpr/xprFrame.c
index fecae5a1b..cddec5ce2 100644
--- a/xorg-server/hw/xquartz/xpr/xprFrame.c
+++ b/xorg-server/hw/xquartz/xpr/xprFrame.c
@@ -173,6 +173,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
if(XQuartzIsRootless)
wc.window_level = normal_window_levels[pFrame->level];
+ else if(XQuartzShieldingWindowLevel)
+ wc.window_level = XQuartzShieldingWindowLevel + 1;
else
wc.window_level = rooted_window_levels[pFrame->level];
mask |= XP_WINDOW_LEVEL;
@@ -287,6 +289,8 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
if(winRec) {
if(XQuartzIsRootless)
wc.window_level = normal_window_levels[winRec->level];
+ else if(XQuartzShieldingWindowLevel)
+ wc.window_level = XQuartzShieldingWindowLevel + 1;
else
wc.window_level = rooted_window_levels[winRec->level];
mask |= XP_WINDOW_LEVEL;
diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c
index bd877d97c..338440a39 100644
--- a/xorg-server/hw/xquartz/xpr/xprScreen.c
+++ b/xorg-server/hw/xquartz/xpr/xprScreen.c
@@ -196,6 +196,13 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height, ScreenPtr pScr
return;
}
+ /* If the displays are captured, we are in a RandR game mode
+ * on the primary display, so we only want to include the first
+ * display. The others are covered by the shield window.
+ */
+ if (CGDisplayIsCaptured(kCGDirectMainDisplay))
+ displayCount = 1;
+
displayList = malloc(displayCount * sizeof(CGDirectDisplayID));
if(!displayList)
FatalError("Unable to allocate memory for list of displays.\n");
@@ -292,9 +299,34 @@ xprAddScreen(int index, ScreenPtr pScreen)
DEBUG_LOG("index=%d depth=%d\n", index, depth);
if(depth == -1) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+#else
+ CGDisplayModeRef modeRef;
+ CFStringRef encStrRef;
+
+ modeRef = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
+ if(!modeRef)
+ goto have_depth;
+
+ encStrRef = CGDisplayModeCopyPixelEncoding(modeRef);
+ CFRelease(modeRef);
+ if(!encStrRef)
+ goto have_depth;
+
+ if(CFStringCompare(encStrRef, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ depth = 24;
+ } else if(CFStringCompare(encStrRef, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ depth = 15;
+ } else if(CFStringCompare(encStrRef, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ depth = 8;
+ }
+
+ CFRelease(encStrRef);
+#endif
}
+have_depth:
switch(depth) {
case 8: // pseudo-working
dfb->visuals = PseudoColorMask;
@@ -319,7 +351,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
// case 24:
default:
if(depth != 24)
- ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay));
+ ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d)\n", depth, darwinDesiredDepth);
dfb->visuals = TrueColorMask; //LARGE_VISUALS;
dfb->preferredCVC = TrueColor;
dfb->depth = 24;