xserver: Branch 'xorg-server-1.4-apple'
Jeremy Huddleston
jeremyhu at kemper.freedesktop.org
Fri Sep 5 17:09:03 PDT 2008
hw/xquartz/X11Application.m | 4 ----
hw/xquartz/X11Controller.m | 3 ---
hw/xquartz/darwin.c | 7 +++++++
hw/xquartz/xpr/xprFrame.c | 4 +---
miext/rootless/rootlessCommon.h | 2 ++
miext/rootless/rootlessWindow.c | 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
New commits:
commit 8dd6d5c825d457f26b41b79d02d57ed4a5ecf1f5
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Fri Sep 5 17:05:03 2008 -0700
XQuartz: 256 color support
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index f965e9f..d0f28e5 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -673,10 +673,6 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
default:darwinDesiredDepth];
-
- // TODO: Add 256 color support
- if(darwinDesiredDepth == 8)
- darwinDesiredDepth = -1;
enable_stereo = [self prefs_get_boolean:@PREFS_ENABLE_STEREO
default:false];
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index e1a2856..e067475 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -657,9 +657,6 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
[enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:NO]];
[depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp prefs_get_integer:@PREFS_DEPTH default:-1]]];
- // TODO: Add 256 color support
- if([depth indexOfItemWithTag:8] != -1)
- [depth removeItemAtIndex:[depth indexOfItemWithTag:8]];
[enable_fullscreen setIntValue:!quartzEnableRootless];
// TODO: Add fullscreen support
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 59d364d..9e1d039 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -219,6 +219,13 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv)
dfb->greenMask, dfb->blueMask)) {
return FALSE;
}
+
+ if(dfb->depth > 8)
+ miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
+ if(dfb->depth > 15)
+ miSetVisualTypesAndMasks(15, LARGE_VISUALS, 5, TrueColor, 0x7c00, 0x03e0, 0x001f);
+ if(dfb->depth > 24)
+ miSetVisualTypesAndMasks(24, LARGE_VISUALS, 8, TrueColor, 0x00ff0000, 0x0000ff00, 0x000000ff);
miSetPixmapDepths();
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index dd0e653..d12e160 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -119,11 +119,9 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
if (pWin->drawable.depth == 8)
{
wc.depth = XP_DEPTH_INDEX8;
-#if 0
- wc.colormap = xprColormapCallback;
+ wc.colormap = RootlessColormapCallback;
wc.colormap_data = pScreen;
mask |= XP_COLORMAP;
-#endif
}
else if (pWin->drawable.depth == 15)
wc.depth = XP_DEPTH_RGB555;
diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h
index 62524b9..ce9d853 100644
--- a/miext/rootless/rootlessCommon.h
+++ b/miext/rootless/rootlessCommon.h
@@ -274,6 +274,8 @@ Bool RootlessResolveColormap (ScreenPtr pScreen, int first_color,
void RootlessFlushWindowColormap (WindowPtr pWin);
void RootlessFlushScreenColormaps (ScreenPtr pScreen);
+RootlessColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors);
+
// Move a window to its proper location on the screen.
void RootlessRepositionWindow(WindowPtr pWin);
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 080de47..4af0d99 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -452,7 +452,7 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec)
Bool
RootlessColormapCallback (void *data, int first_color, int n_colors, uint32_t *colors)
{
- return RootlessResolveColormap (data, first_color, n_colors, colors);
+ return (RootlessResolveColormap (data, first_color, n_colors, colors) ? XP_Success : XP_BadMatch);
}
/*
More information about the xorg-commit
mailing list