xserver: Branch 'xorg-server-1.2-apple' - 2 commits
Ben Byer
bbyer at kemper.freedesktop.org
Thu Nov 8 22:17:41 PST 2007
hw/darwin/quartz/quartz.c | 84 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 81 insertions(+), 3 deletions(-)
New commits:
commit 24ba8a985fa9e478f805dca742f4ee8d15ef3d45
Author: Ben Byer <bbyer at bbyer.apple.com>
Date: Thu Nov 8 22:17:38 2007 -0800
fix for spurious "Are you sure you want to quit?" message
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index a0eb4ed..34f5e45 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -186,6 +186,7 @@ void DarwinModeInitInput(
char **argv )
{
#ifdef INXQUARTZ
+ X11ApplicationSetCanQuit(1);
X11ApplicationServerReady();
#else
QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
commit b36f667a34bac249a53d530e04301d3a97f2d180
Author: Ben Byer <bbyer at bbyer.apple.com>
Date: Thu Nov 8 22:12:41 2007 -0800
Adding "fake RandR" support from old X11.app
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index eccb4ef..a0eb4ed 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -52,6 +52,8 @@
#include <fcntl.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
+#define FAKE_RANDR 1
+
// Shared global variables for Quartz modes
int quartzEventWriteFD = -1;
int quartzStartClients = 1;
@@ -67,6 +69,30 @@ int noPseudoramiXExtension = FALSE;
QuartzModeProcsPtr quartzProcs = NULL;
const char *quartzOpenGLBundle = NULL;
+#if defined(RANDR) && !defined(FAKE_RANDR)
+Bool DarwinModeRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) {
+ return FALSE;
+}
+
+Bool DarwinModeRandRSetConfig (ScreenPtr pScreen,
+ Rotation randr,
+ int rate,
+ RRScreenSizePtr pSize) {
+ return FALSE;
+}
+
+Bool DarwinModeRandRInit (ScreenPtr pScreen) {
+ rrScrPrivPtr pScrPriv;
+
+ if (!RRScreenInit (pScreen)) return FALSE;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+ pScrPriv->rrGetInfo = DarwinModeRandRGetInfo;
+ pScrPriv->rrSetConfig = DarwinModeRandRSetConfig;
+ return TRUE;
+}
+#endif
+
/*
===========================================================================
@@ -170,6 +196,51 @@ void DarwinModeInitInput(
}
+#ifdef FAKE_RANDR
+extern char *ConnectionInfo;
+
+static int padlength[4] = {0, 3, 2, 1};
+
+static void
+RREditConnectionInfo (ScreenPtr pScreen)
+{
+ xConnSetup *connSetup;
+ char *vendor;
+ xPixmapFormat *formats;
+ xWindowRoot *root;
+ xDepth *depth;
+ xVisualType *visual;
+ int screen = 0;
+ int d;
+
+ connSetup = (xConnSetup *) ConnectionInfo;
+ vendor = (char *) connSetup + sizeof (xConnSetup);
+ formats = (xPixmapFormat *) ((char *) vendor +
+ connSetup->nbytesVendor +
+ padlength[connSetup->nbytesVendor & 3]);
+ root = (xWindowRoot *) ((char *) formats +
+ sizeof (xPixmapFormat) * screenInfo.numPixmapFormats);
+ while (screen != pScreen->myNum)
+ {
+ depth = (xDepth *) ((char *) root +
+ sizeof (xWindowRoot));
+ for (d = 0; d < root->nDepths; d++)
+ {
+ visual = (xVisualType *) ((char *) depth +
+ sizeof (xDepth));
+ depth = (xDepth *) ((char *) visual +
+ depth->nVisuals * sizeof (xVisualType));
+ }
+ root = (xWindowRoot *) ((char *) depth);
+ screen++;
+ }
+ root->pixWidth = pScreen->width;
+ root->pixHeight = pScreen->height;
+ root->mmWidth = pScreen->mmWidth;
+ root->mmHeight = pScreen->mmHeight;
+}
+#endif
+
/*
* QuartzUpdateScreens
* Adjust for screen arrangement changes.
@@ -181,6 +252,7 @@ static void QuartzUpdateScreens(void)
int x, y, width, height, sx, sy;
xEvent e;
+ ErrorF("QuartzUpdateScreens()\n");
if (noPseudoramiXExtension || screenInfo.numScreens != 1)
{
/* FIXME: if not using Xinerama, we have multiple screens, and
@@ -202,8 +274,11 @@ static void QuartzUpdateScreens(void)
pScreen->mmHeight = pScreen->mmHeight * ((double) height / pScreen->height);
pScreen->width = width;
pScreen->height = height;
-
- /* FIXME: should probably do something with RandR here. */
+
+#ifndef FAKE_RANDR
+ if(!DarwinModeRandRInit(pScreen))
+ FatalError("Failed to init RandR extension.\n");
+#endif
DarwinAdjustScreenOrigins(&screenInfo);
quartzProcs->UpdateScreen(pScreen);
@@ -231,7 +306,9 @@ static void QuartzUpdateScreens(void)
e.u.configureNotify.override = pRoot->overrideRedirect;
DeliverEvents(pRoot, &e, 1, NullWindow);
- /* FIXME: Should we use RREditConnectionInfo(pScreen)? */
+#ifdef FAKE_RANDR
+ RREditConnectionInfo(pScreen);
+#endif
}
More information about the xorg-commit
mailing list