From Jeremy Huddleston:

1) Fixed a bug where XQUARTZ was #defined when auto but not when --enable-xquartz
2) Cleaned up missing #includes and function prototypes.
3) Fixed some invalid C syntax problems
4) Removed a bunch of dead code
5) Cleaned up code to prevent some warnings
6) Bugfix in xpr/x-hook.c - looks like someone just forgot to finish writing code for hook_remove()... I only noticed it because gcc -Wall complained about reaching the end of a non-void function... lucky for us gcc is smarter than we are.
This commit is contained in:
Ben Byer 2007-11-16 05:04:54 -08:00 committed by Jeremy Huddleston
parent 41eabe5d4c
commit cee516e142
18 changed files with 79 additions and 178 deletions

View file

@ -1708,7 +1708,6 @@ if test "X$XQUARTZ" = Xauto; then
LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then
AC_DEFINE([XQUARTZ],[1],[Have Quartz])
XQUARTZ=yes
else
XQUARTZ=no
@ -1716,15 +1715,7 @@ if test "X$XQUARTZ" = Xauto; then
fi
if test "x$XQUARTZ" = xyes; then
if test "x$X11APP" = xauto; then
AC_MSG_CHECKING([whether to build X11.app])
if test "x$XQUARTZ" = xyes ; then
X11APP=yes
else
X11APP=no
fi
AC_MSG_RESULT([$X11APP])
fi
AC_DEFINE([XQUARTZ],[1],[Have Quartz])
# glxAGL / glxCGL don't work yet
# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
@ -1767,6 +1758,16 @@ if test "x$XQUARTZ" = xyes; then
fi
fi
if test "x$X11APP" = xauto; then
AC_MSG_CHECKING([whether to build X11.app])
if test "x$XQUARTZ" = xyes ; then
X11APP=yes
else
X11APP=no
fi
AC_MSG_RESULT([$X11APP])
fi
if test "x$LAUNCHD" = xauto; then
# Do we want to have this default to on for Xquartz builds only or any time we have launchd (like Xnest or Xvfb on OS-X)
#AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])

View file

@ -260,11 +260,6 @@ main(int argc, char *argv[], char *envp[])
/* Quartz support on Mac OS X requires that the Cocoa event loop be in
* the main thread. This allows the X server main to be called again
* from another thread. */
/* TODO: Put some runtime conditioning on this, so it doesn't get
* executed by Xvfb, Xnest, Xfake, Xephyr, etc when built at the same
* time as Xquartz
*/
DarwinHandleGUI(argc, argv, envp);
#endif

View file

@ -1,5 +1,5 @@
AM_CFLAGS = @XORG_CFLAGS@
AM_CPPFLAGS = @XORG_INCS@ -I../../miext/rootless -DUSE_NEW_CLUT -DBUILD_DATE=\"$(BUILD_DATE)\" -DHAVE_XORG_CONFIG_H -DXFree86Server -DINXQUARTZ
AM_CPPFLAGS = @XORG_INCS@ -I$(top_srcdir)/Xext -I$(top_srcdir)/miext/rootless -DUSE_NEW_CLUT -DBUILD_DATE=\"$(BUILD_DATE)\" -DHAVE_XORG_CONFIG_H -DXFree86Server -DINXQUARTZ
SUBDIRS = quartz utils

View file

@ -47,6 +47,10 @@
#include <unistd.h>
#include <pthread.h>
#include "rootlessCommon.h"
WindowPtr xprGetXWindowFromAppKit(int windowNumber); // xpr/xprFrame.c
#define DEFAULTS_FILE "/usr/X11/lib/X11/xserver/Xquartz.plist"
int X11EnableKeyEquivalents = TRUE;
@ -577,7 +581,7 @@ cfarray_to_nsarray (CFArrayRef in)
ret = CFBooleanGetValue (value);
else if (CFGetTypeID (value) == CFStringGetTypeID ())
{
const char *tem = [(NSString *) value lossyCString];
const char *tem = [(NSString *) value UTF8String];
if (strcasecmp (tem, "true") == 0 || strcasecmp (tem, "yes") == 0)
ret = YES;
else

View file

@ -69,6 +69,11 @@
#include <IOKit/hidsystem/IOHIDLib.h>
#include <IOKit/hidsystem/ev_keymap.h>
#ifdef MITSHM
#define _XSHM_SERVER_
#include <X11/extensions/XShm.h>
#endif
#include "darwin.h"
#include "darwinClut8.h"
@ -186,7 +191,9 @@ static Bool DarwinAddScreen(
// allocate space for private per screen storage
dfb = xalloc(sizeof(DarwinFramebufferRec));
SCREEN_PRIV(pScreen) = dfb;
// SCREEN_PRIV(pScreen) = dfb;
pScreen->devPrivates[darwinScreenIndex].ptr = dfb;
// setup hardware/mode specific details
ret = DarwinModeAddScreen(foundIndex, pScreen);
@ -342,7 +349,7 @@ static int DarwinMouseProc(
DeviceIntPtr pPointer,
int what )
{
char map[6];
CARD8 map[6];
switch (what) {
@ -699,10 +706,30 @@ void ddxInitGlobals(void)
*/
int ddxProcessArgument( int argc, char *argv[], int i )
{
int numDone;
if ( !strcmp( argv[i], "-fullscreen" ) ) {
ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
return 1;
}
if ((numDone = DarwinModeProcessArgument( argc, argv, i )))
return numDone;
if ( !strcmp( argv[i], "-rootless" ) ) {
ErrorF( "Running rootless inside Mac OS X window server.\n" );
return 1;
}
if ( !strcmp( argv[i], "-quartz" ) ) {
ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
return 1;
}
// The Mac OS X front end uses this argument, which we just ignore here.
if ( !strcmp( argv[i], "-nostartx" ) ) {
return 1;
}
// This command line arg is passed when launched from the Aqua GUI.
if ( !strncmp( argv[i], "-psn_", 5 ) ) {
return 1;
}
if ( !strcmp( argv[i], "-fakebuttons" ) ) {
darwinFakeButtons = TRUE;

View file

@ -76,7 +76,6 @@ Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
void DarwinModeInitOutput(int argc,char **argv);
void DarwinModeInitInput(int argc, char **argv);
int DarwinModeProcessArgument(int argc, char *argv[], int i);
void DarwinModeProcessEvent(xEvent *xe);
void DarwinModeGiveUp(void);
void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);

View file

@ -257,7 +257,7 @@ static void DarwinUpdateModifiers(
void DarwinReleaseModifiers(void) {
KeySym *map = NULL;
xEvent ke;
int i = 0, j = 0, nevents = 0;
int i = 0;
DEBUG_LOG("DarwinReleaseModifiers(%p)\n", &keyInfo.keyMap);

View file

@ -2,7 +2,7 @@ noinst_LIBRARIES = libXQuartz.a
AM_CFLAGS = @XORG_CFLAGS@
AM_OBJCFLAGS = @XORG_CFLAGS@
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@ -DXBINDIR=\"${bindir}\" -DHAS_KL_API -DHAVE_XORG_CONFIG_H
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../apple -I$(top_srcdir)/miext/rootless @XORG_INCS@ -DXBINDIR=\"${bindir}\" -DHAS_KL_API -DHAVE_XORG_CONFIG_H
SUBDIRS = cr fullscreen xpr

View file

@ -47,6 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _APPLEWM_SERVER_
#include "X11/extensions/applewmstr.h"
#include "applewmExt.h"
#include "X11Application.h"
#define DEFINE_ATOM_HELPER(func,atom_name) \
static Atom func (void) { \

View file

@ -40,11 +40,14 @@
#include "X11/extensions/applewm.h"
#include "applewmExt.h"
#include "X11Application.h"
// X headers
#include "scrnintstr.h"
#include "windowstr.h"
#include "colormapst.h"
#include "globals.h"
#include "rootlessWindow.h"
// System headers
#include <sys/types.h>
@ -111,7 +114,9 @@ Bool DarwinModeAddScreen(
{
// allocate space for private per screen Quartz specific storage
QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
QUARTZ_PRIV(pScreen) = displayInfo;
// QUARTZ_PRIV(pScreen) = displayInfo;
pScreen->devPrivates[quartzScreenIndex].ptr = displayInfo;
// do Quartz mode specific initialization
return quartzProcs->AddScreen(index, pScreen);

View file

@ -124,6 +124,4 @@ typedef struct _QuartzModeProcs {
extern QuartzModeProcsPtr quartzProcs;
extern int quartzHasRoot, quartzEnableRootless;
Bool QuartzLoadDisplayBundle(const char *dpyBundleName);
#endif

View file

@ -40,14 +40,10 @@ char **envpGlobal; // argcGlobal and argvGlobal
// are from dix/globals.c
void X11ControllerMain(int argc, char *argv[],
void (*server_thread) (void *), void *server_arg);
void GlxExtensionInit(void);
void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr);
void X11ControllerMain(int argc, char *argv[], void (*server_thread) (void *), void *server_arg);
static void server_thread (void *arg) {
extern int main(int argc, char **argv, char **envp);
exit (main (argcGlobal, argvGlobal, envpGlobal));
}
@ -65,7 +61,7 @@ void DarwinHandleGUI(
char *envp[] )
{
static Bool been_here = FALSE;
int main_exit, i;
int i;
int fd[2];
if (been_here) {
@ -107,141 +103,5 @@ void DarwinHandleGUI(
_InitHLTB();
X11ControllerMain(argc, argv, server_thread, NULL);
exit(main_exit);
}
/*
* QuartzLoadDisplayBundle
* Try to load the appropriate bundle containing the back end display code.
*/
Bool QuartzLoadDisplayBundle(
const char *dpyBundleName)
{
return TRUE;
}
#ifdef GLXEXT
/*
* LoadGlxBundle
* The Quartz mode X server needs to dynamically load the appropriate
* bundle before initializing GLX.
*/
static void LoadGlxBundle(void)
{
CFBundleRef mainBundle;
CFStringRef bundleName;
CFURLRef bundleURL;
CFBundleRef glxBundle;
// Get the main bundle for the application
mainBundle = CFBundleGetMainBundle();
// Choose the bundle to load
ErrorF("Loading GLX bundle ");
if (/*quartzUseAGL*/0) {
bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
quartzOpenGLBundle,
kCFStringEncodingASCII,
kCFAllocatorNull);
ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle);
} else {
bundleName = CFSTR("glxMesa.bundle");
CFRetain(bundleName); // so we can release later
ErrorF("glxMesa.bundle (using Mesa)\n");
}
// Look for the appropriate GLX bundle in the main bundle by name
bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
NULL, NULL);
if (!bundleURL) {
FatalError("Could not find GLX bundle.");
}
// Make a bundle instance using the URLRef
glxBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
if (!CFBundleLoadExecutable(glxBundle)) {
FatalError("Could not load GLX bundle.");
}
// Find the GLX init functions
if (!GlxExtensionInit || !GlxWrapInitVisuals) {
FatalError("Could not initialize GLX bundle.");
}
// Release the CF objects
CFRelease(bundleName);
CFRelease(bundleURL);
}
# endif
#else
Bool QuartzLoadDisplayBundle(const char *dpyBundleName)
{
return TRUE;
}
/*
* DarwinGlxExtensionInit
* Initialize the GLX extension.
*/
void DarwinGlxPushProvider(void *impl)
{
GlxPushProvider(impl);
}
/*
* DarwinGlxExtensionInit
* Initialize the GLX extension.
*/
void DarwinGlxExtensionInit(void)
{
GlxExtensionInit();
}
/*
* DarwinGlxWrapInitVisuals
*/
void DarwinGlxWrapInitVisuals(
miInitVisualsProcPtr *procPtr)
{
if (!GlxWrapInitVisuals)
LoadGlxBundle();
GlxWrapInitVisuals(procPtr);
}
#endif
int DarwinModeProcessArgument( int argc, char *argv[], int i )
{
// fullscreen: CoreGraphics full-screen mode
// rootless: Cocoa rootless mode
// quartz: Default, either fullscreen or rootless
if ( !strcmp( argv[i], "-fullscreen" ) ) {
ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
return 1;
}
if ( !strcmp( argv[i], "-rootless" ) ) {
ErrorF( "Running rootless inside Mac OS X window server.\n" );
return 1;
}
if ( !strcmp( argv[i], "-quartz" ) ) {
ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
return 1;
}
// The Mac OS X front end uses this argument, which we just ignore here.
if ( !strcmp( argv[i], "-nostartx" ) ) {
return 1;
}
// This command line arg is passed when launched from the Aqua GUI.
if ( !strncmp( argv[i], "-psn_", 5 ) ) {
return 1;
}
return 0;
exit(0);
}

View file

@ -175,7 +175,7 @@ ProcAppleDRIAuthConnection(
rep.authenticated = 1;
if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
ErrorF("Failed to authenticate %u\n", stuff->magic);
ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
rep.authenticated = 0;
}
WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);

View file

@ -50,12 +50,19 @@ X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
{
x_list *node, *cell;
x_list *to_delete = NULL;
x_list *prev = NULL;
for (node = lst; node != NULL; node = node->next)
for (node = lst; node != NULL; prev = node, node = node->next)
{
cell = node->data;
if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data)
{
to_delete = X_PFX (list_prepend) (to_delete, cell);
if(lst == node)
lst = node->next;
else
prev->next = node->next;
}
}
for (node = to_delete; node != NULL; node = node->next)
@ -66,6 +73,7 @@ X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
}
X_PFX (list_free) (to_delete);
return lst;
}
X_EXTERN void

View file

@ -381,7 +381,8 @@ QuartzInitCursor(ScreenPtr pScreen)
if (ScreenPriv == NULL)
return FALSE;
CURSOR_PRIV(pScreen) = ScreenPriv;
/* CURSOR_PRIV(pScreen) = ScreenPriv; */
pScreen->devPrivates[darwinCursorScreenIndex].ptr = ScreenPriv;
/* override some screen procedures */
ScreenPriv->QueryBestSize = pScreen->QueryBestSize;

View file

@ -42,6 +42,9 @@
#include "Xplugin.h"
#include "quartz/applewmExt.h"
// From xprFrame.c
WindowPtr xprGetXWindow(xp_window_id wid);
#ifdef DAMAGE
# include "damage.h"
#endif

View file

@ -661,12 +661,8 @@ InitVisualWrap()
{
miResetInitVisuals();
#ifdef GLXEXT
#ifdef INXQUARTZ
DarwinGlxWrapInitVisuals(&miInitVisualsProc);
#else
GlxWrapInitVisuals(&miInitVisualsProc);
#endif
#endif
}
#else /* XFree86LOADER */

View file

@ -36,6 +36,7 @@
#include "rootlessCommon.h"
#include <Xplugin.h>
Bool RootlessCreateWindow(WindowPtr pWin);
Bool RootlessDestroyWindow(WindowPtr pWin);
@ -59,5 +60,7 @@ void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion,
void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion,
int what);
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
void RootlessNativeWindowMoved (WindowPtr pWin);
void RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state);
#endif