Merge branch 'master' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver

This commit is contained in:
Matthieu Herrb 2008-11-23 13:15:46 +01:00
commit 387563b777
14 changed files with 254 additions and 63 deletions

View File

@ -1878,6 +1878,7 @@ hw/vfb/Makefile
hw/xnest/Makefile hw/xnest/Makefile
hw/xwin/Makefile hw/xwin/Makefile
hw/xquartz/Makefile hw/xquartz/Makefile
hw/xquartz/GL/Makefile
hw/xquartz/bundle/Makefile hw/xquartz/bundle/Makefile
hw/xquartz/doc/Makefile hw/xquartz/doc/Makefile
hw/xquartz/mach-startup/Makefile hw/xquartz/mach-startup/Makefile

View File

@ -25,7 +25,7 @@ xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
BUILT_SOURCES = xf86DefModeSet.c BUILT_SOURCES = xf86DefModeSet.c
AM_LDFLAGS = -r AM_LDFLAGS = -r
libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
xf86Cursor.c xf86DGA.c xf86DPMS.c \ xf86Cursor.c xf86DGA.c xf86DPMS.c \
xf86DoProbe.c xf86Events.c \ xf86DoProbe.c xf86Events.c \
xf86Globals.c xf86AutoConfig.c \ xf86Globals.c xf86AutoConfig.c \

View File

@ -56,6 +56,7 @@
/* General parameters */ /* General parameters */
extern int xf86DoConfigure; extern int xf86DoConfigure;
extern int xf86DoShowOptions;
extern Bool xf86DoModalias; extern Bool xf86DoModalias;
extern Bool xf86DoConfigurePass1; extern Bool xf86DoConfigurePass1;
extern DevPrivateKey xf86ScreenKey; extern DevPrivateKey xf86ScreenKey;

View File

@ -153,6 +153,7 @@ Bool xf86Resetting = FALSE;
Bool xf86Initialising = FALSE; Bool xf86Initialising = FALSE;
Bool xf86DoProbe = FALSE; Bool xf86DoProbe = FALSE;
Bool xf86DoConfigure = FALSE; Bool xf86DoConfigure = FALSE;
Bool xf86DoShowOptions = FALSE;
Bool xf86DoModalias = FALSE; Bool xf86DoModalias = FALSE;
DriverPtr *xf86DriverList = NULL; DriverPtr *xf86DriverList = NULL;
int xf86NumDrivers = 0; int xf86NumDrivers = 0;

View File

@ -688,7 +688,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
} }
/* Read and parse the config file */ /* Read and parse the config file */
if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias) { if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias && !xf86DoShowOptions) {
switch (xf86HandleConfigFile(FALSE)) { switch (xf86HandleConfigFile(FALSE)) {
case CONFIG_OK: case CONFIG_OK:
break; break;
@ -713,6 +713,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL);
} }
if (xf86DoShowOptions)
DoShowOptions();
xf86OpenConsole(); xf86OpenConsole();
/* Do a general bus probe. This will be a PCI probe for x86 platforms */ /* Do a general bus probe. This will be a PCI probe for x86 platforms */
@ -1774,6 +1777,15 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86AllowMouseOpenFail = TRUE; xf86AllowMouseOpenFail = TRUE;
return 1; return 1;
} }
if (!strcmp(argv[i], "-showopts"))
{
if (getuid() != 0 && geteuid() == 0) {
ErrorF("The '-showopts' option can only be used by root.\n");
exit(1);
}
xf86DoShowOptions = TRUE;
return 1;
}
if (!strcmp(argv[i], "-isolateDevice")) if (!strcmp(argv[i], "-isolateDevice"))
{ {
int bus, device, func; int bus, device, func;
@ -1812,6 +1824,7 @@ ddxUseMsg()
ErrorF("-modulepath paths specify the module search path\n"); ErrorF("-modulepath paths specify the module search path\n");
ErrorF("-logfile file specify a log file name\n"); ErrorF("-logfile file specify a log file name\n");
ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n"); ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n");
ErrorF("-showopts print available options for all installed drivers\n");
} }
ErrorF("-modalias output a modalias-style filter for each driver installed\n"); ErrorF("-modalias output a modalias-style filter for each driver installed\n");
ErrorF("-config file specify a configuration file, relative to the\n"); ErrorF("-config file specify a configuration file, relative to the\n");

View File

@ -153,6 +153,7 @@ extern const int xf86NumDefaultModes;
/* xf86DoProbe.c */ /* xf86DoProbe.c */
void DoProbe(void); void DoProbe(void);
void DoConfigure(void); void DoConfigure(void);
void DoShowOptions(void);
/* xf86Events.c */ /* xf86Events.c */

View File

@ -0,0 +1,129 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86ShopwOpts.c,v 3.80 2003/10/08 14:58:27 dawes Exp $ */
/*
* Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Alan Hourihane not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Alan Hourihane makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* Author: Marcus Schaefer, ms@suse.de
*
*/
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <X11/X.h>
#include <X11/Xmd.h>
#include "os.h"
#ifdef XFree86LOADER
#include "loaderProcs.h"
#endif
#include "xf86.h"
#include "xf86Config.h"
#include "xf86_OSlib.h"
#include "xf86Priv.h"
/* #include "xf86PciData.h" */
#define IN_XSERVER
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "Configint.h"
#include "vbe.h"
#include "xf86DDC.h"
#if defined(__sparc__) && !defined(__OpenBSD__)
#include "xf86Bus.h"
#include "xf86Sbus.h"
#endif
#include "globals.h"
static const char*
optionTypeToSting(OptionValueType type)
{
switch (type) {
case OPTV_NONE:
return "";
case OPTV_INTEGER:
return "<int>";
case OPTV_STRING:
return "<str>";
case OPTV_ANYSTR:
return "<str>";
case OPTV_REAL:
return "<real>";
case OPTV_BOOLEAN:
return "<bool>";
case OPTV_FREQ:
return "<freq>";
default:
return "<undef>";
}
}
void DoShowOptions (void) {
int i = 0;
char **vlist = 0;
char *pSymbol = 0;
XF86ModuleData *initData = 0;
if (! (vlist = xf86DriverlistFromCompile())) {
ErrorF("Missing output drivers\n");
goto bail;
}
xf86LoadModules (vlist,0);
xfree (vlist);
for (i = 0; i < xf86NumDrivers; i++) {
if (xf86DriverList[i]->AvailableOptions) {
OptionInfoPtr pOption = (OptionInfoPtr)(*xf86DriverList[i]->AvailableOptions)(0,0);
if (! pOption) {
ErrorF ("(EE) Couldn't read option table for %s driver\n",
xf86DriverList[i]->driverName
);
continue;
}
pSymbol = xalloc (
strlen(xf86DriverList[i]->driverName) + strlen("ModuleData") + 1
);
strcpy (pSymbol, xf86DriverList[i]->driverName);
strcat (pSymbol, "ModuleData");
initData = LoaderSymbol (pSymbol);
if (initData) {
XF86ModuleVersionInfo *vers = initData->vers;
ErrorF ("Driver[%d]:%s[%s] {\n",
i,xf86DriverList[i]->driverName,vers->vendor
);
OptionInfoPtr p;
for (p = pOption; p->name != NULL; p++) {
const char *opttype = optionTypeToSting(p->type);
char *optname = xalloc(strlen(p->name) + 2 + 1);
if (!optname) {
continue;
}
sprintf(optname, "%s", p->name);
ErrorF ("\t%s:%s\n", optname,opttype);
}
ErrorF ("}\n");
}
}
}
bail:
OsCleanup (TRUE);
AbortDDX ();
fflush (stderr);
exit (0);
}

View File

@ -81,7 +81,6 @@
typedef unsigned long long GLuint64EXT; typedef unsigned long long GLuint64EXT;
typedef long long GLint64EXT; typedef long long GLint64EXT;
#include <Xplugin.h> #include <Xplugin.h>
#include "glcontextmodes.h"
#include <glapi.h> #include <glapi.h>
#include <glapitable.h> #include <glapitable.h>
@ -156,7 +155,7 @@ struct __GLXAquaContext {
}; };
struct __GLXAquaDrawable { struct __GLXAquaDrawable {
__GLXdrawable base; __GLXdrawable base;
DrawablePtr pDraw; DrawablePtr pDraw;
xp_surface_id sid; xp_surface_id sid;
}; };
@ -298,49 +297,61 @@ static void surface_notify(void *_arg, void *data) {
} }
} }
static void attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) { static BOOL attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) {
DrawablePtr pDraw; DrawablePtr pDraw;
GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw);
GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw);
if(NULL == context || NULL == draw)
return TRUE;
pDraw = draw->base.pDraw; pDraw = draw->base.pDraw;
if (draw->sid == 0) { if(NULL == pDraw) {
// if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, ErrorF("%s:attach() pDraw is NULL!\n", __FILE__);
if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw, return TRUE;
0, &draw->sid, NULL, }
surface_notify, draw))
return;
draw->pDraw = pDraw;
}
if (draw->sid == 0) {
//if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw,
0, &draw->sid, NULL,
surface_notify, draw))
return TRUE;
draw->pDraw = pDraw;
}
if (!context->isAttached || context->sid != draw->sid) { if (!context->isAttached || context->sid != draw->sid) {
x_list *lst; x_list *lst;
if (xp_attach_gl_context(context->ctx, draw->sid) != Success) { if (xp_attach_gl_context(context->ctx, draw->sid) != Success) {
// quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, //quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw, DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw,
surface_notify, draw); surface_notify, draw);
if (surface_hash != NULL) if (surface_hash != NULL)
x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(draw->sid)); x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(draw->sid));
draw->sid = 0; draw->sid = 0;
return; return TRUE;
} }
context->isAttached = TRUE; context->isAttached = TRUE;
context->sid = draw->sid; context->sid = draw->sid;
if (surface_hash == NULL) if (surface_hash == NULL)
surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
lst = x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(context->sid), NULL); lst = x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(context->sid), NULL);
if (x_list_find(lst, context) == NULL) { if (x_list_find(lst, context) == NULL) {
lst = x_list_prepend(lst, context); lst = x_list_prepend(lst, context);
x_hash_table_insert(surface_hash, x_cvt_uint_to_vptr(context->sid), lst); x_hash_table_insert(surface_hash, x_cvt_uint_to_vptr(context->sid), lst);
} }
GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id, GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id,
(unsigned int) draw->sid); (unsigned int) draw->sid);
} }
return FALSE;
} }
#if 0 // unused #if 0 // unused
@ -370,11 +381,12 @@ static void unattach(__GLXAquaContext *context) {
static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext) { static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext) {
CGLError gl_err; CGLError gl_err;
__GLXAquaContext *context = (__GLXAquaContext *) baseContext; __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
__GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv; __GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv;
GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext); GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext);
attach(context, drawPriv); if(attach(context, drawPriv))
return /*error*/ 0;
gl_err = CGLSetCurrentContext(context->ctx); gl_err = CGLSetCurrentContext(context->ctx);
if (gl_err != 0) if (gl_err != 0)
@ -1310,8 +1322,8 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
screen->base.fbconfigs = configs; screen->base.fbconfigs = configs;
screen->base.numFBConfigs = 1; screen->base.numFBConfigs = 1;
screen->base.visuals = configs; screen->base.visuals = NULL;
screen->base.numVisuals = 1; screen->base.numVisuals = 0;
GlxSetVisualConfig(GLX_ALL_VISUALS); GlxSetVisualConfig(GLX_ALL_VISUALS);
@ -1337,14 +1349,34 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
return &screen->base; return &screen->base;
} }
static void __glXAquaDrawableDestroy(__GLXdrawable *base) { static void __glXAquaDrawableCopySubBuffer (__GLXdrawable *drawable,
GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); int x, int y, int w, int h) {
/*TODO finish me*/
}
static void __glXAquaDrawableDestroy(__GLXdrawable *base) {
/* gstaplin: base is the head of the structure, so it's at the same
* offset in memory.
* Is this safe with strict aliasing? I noticed that the other dri code
* does this too...
*/
__GLXAquaDrawable *glxPriv = (__GLXAquaDrawable *)base;
GLAQUA_DEBUG_MSG(__func__);
/* It doesn't work to call DRIDestroySurface here, the drawable's /* It doesn't work to call DRIDestroySurface here, the drawable's
already gone.. But dri.c notices the window destruction and already gone.. But dri.c notices the window destruction and
frees the surface itself. */ frees the surface itself. */
free(base); /*gstaplin: verify the statement above. The surface destroy
*messages weren't making it through, and may still not be.
*We need a good test case for surface creation and destruction.
*We also need a good way to enable introspection on the server
*to validate the test, beyond using gdb with print.
*/
xfree(glxPriv);
} }
static __GLXdrawable * static __GLXdrawable *
@ -1358,11 +1390,13 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes); GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
glxPriv = xalloc(sizeof *glxPriv); glxPriv = xalloc(sizeof *glxPriv);
if (glxPriv == NULL) return NULL;
if(glxPriv == NULL)
return NULL;
memset(glxPriv, 0, sizeof *glxPriv); memset(glxPriv, 0, sizeof *glxPriv);
if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) { if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) {
xfree(glxPriv); xfree(glxPriv);
return NULL; return NULL;
} }
@ -1370,7 +1404,7 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
glxPriv->base.destroy = __glXAquaDrawableDestroy; glxPriv->base.destroy = __glXAquaDrawableDestroy;
glxPriv->base.resize = __glXAquaDrawableResize; glxPriv->base.resize = __glXAquaDrawableResize;
glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers; glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
// glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer; glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
return &glxPriv->base; return &glxPriv->base;
} }

View File

@ -13,9 +13,9 @@ if GLX
GL_DIR = GL GL_DIR = GL
endif endif
SUBDIRS = bundle . GL xpr pbproxy mach-startup doc SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup doc
DIST_SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup doc DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup doc
libXquartz_la_SOURCES = \ libXquartz_la_SOURCES = \
$(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/fb/fbcmap_mi.c \

View File

@ -345,7 +345,6 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) {
// Set button map. // Set button map.
InitPointerDeviceStruct((DevicePtr)pPointer, map, 7, InitPointerDeviceStruct((DevicePtr)pPointer, map, 7,
GetMotionHistory,
(PtrCtrlProcPtr)NoopDDA, (PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), 2); GetMotionHistorySize(), 2);
InitAbsoluteClassDeviceStruct(pPointer); InitAbsoluteClassDeviceStruct(pPointer);
@ -376,7 +375,6 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
// Set button map. // Set button map.
InitPointerDeviceStruct((DevicePtr)pPointer, map, 3, InitPointerDeviceStruct((DevicePtr)pPointer, map, 3,
GetMotionHistory,
(PtrCtrlProcPtr)NoopDDA, (PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), 5); GetMotionHistorySize(), 5);
pPointer->valuator->mode = Absolute; // Relative pPointer->valuator->mode = Absolute; // Relative
@ -477,7 +475,7 @@ int DarwinParseModifierList(const char *constmodifiers, int separatelr)
*/ */
void InitInput( int argc, char **argv ) void InitInput( int argc, char **argv )
{ {
darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE); darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
RegisterKeyboardDevice( darwinKeyboard ); RegisterKeyboardDevice( darwinKeyboard );
darwinKeyboard->name = strdup("keyboard"); darwinKeyboard->name = strdup("keyboard");
@ -495,19 +493,19 @@ void InitInput( int argc, char **argv )
gdkdev->info.source = GDK_SOURCE_PEN; gdkdev->info.source = GDK_SOURCE_PEN;
*/ */
darwinPointer = AddInputDevice(DarwinMouseProc, TRUE); darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE);
RegisterPointerDevice( darwinPointer ); RegisterPointerDevice( darwinPointer );
darwinPointer->name = strdup("pointer"); darwinPointer->name = strdup("pointer");
darwinTabletStylus = AddInputDevice(DarwinTabletProc, TRUE); darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
RegisterPointerDevice( darwinTabletStylus ); RegisterPointerDevice( darwinTabletStylus );
darwinTabletStylus->name = strdup("pen"); darwinTabletStylus->name = strdup("pen");
darwinTabletCursor = AddInputDevice(DarwinTabletProc, TRUE); darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
RegisterPointerDevice( darwinTabletCursor ); RegisterPointerDevice( darwinTabletCursor );
darwinTabletCursor->name = strdup("cursor"); darwinTabletCursor->name = strdup("cursor");
darwinTabletEraser = AddInputDevice(DarwinTabletProc, TRUE); darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
RegisterPointerDevice( darwinTabletEraser ); RegisterPointerDevice( darwinTabletEraser );
darwinTabletEraser->name = strdup("eraser"); darwinTabletEraser->name = strdup("eraser");

View File

@ -84,7 +84,7 @@ static pthread_mutex_t fd_add_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER; static pthread_cond_t fd_add_ready_cond = PTHREAD_COND_INITIALIZER;
static pthread_t fd_add_tid = NULL; static pthread_t fd_add_tid = NULL;
static xEvent *darwinEvents = NULL; static EventList *darwinEvents = NULL;
static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER; static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER;
@ -324,7 +324,7 @@ Bool DarwinEQInit(void) {
* here, so I don't bother. * here, so I don't bother.
*/ */
if (!darwinEvents) { if (!darwinEvents) {
darwinEvents = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum()); darwinEvents = InitEventList(GetMaximumEventsNum());;
if (!darwinEvents) if (!darwinEvents)
FatalError("Couldn't allocate event buffer\n"); FatalError("Couldn't allocate event buffer\n");
@ -450,7 +450,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
darwinEvents_lock(); { darwinEvents_lock(); {
num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button, num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button,
POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators); POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, &darwinEvents[i]); for(i=0; i<num_events; i++) mieqEnqueue (pDev, darwinEvents[i].event);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }
@ -465,7 +465,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) {
darwinEvents_lock(); { darwinEvents_lock(); {
num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE); num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,&darwinEvents[i]); for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,darwinEvents[i].event);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }
@ -493,7 +493,7 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
darwinEvents_lock(); { darwinEvents_lock(); {
num_events = GetProximityEvents(darwinEvents, dev, ev_type, num_events = GetProximityEvents(darwinEvents, dev, ev_type,
0, 5, valuators); 0, 5, valuators);
for(i=0; i<num_events; i++) mieqEnqueue (dev,&darwinEvents[i]); for(i=0; i<num_events; i++) mieqEnqueue (dev,darwinEvents[i].event);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }

View File

@ -432,7 +432,7 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
DeviceIntPtr pDev; DeviceIntPtr pDev;
/* From ProcSetModifierMapping */ /* From ProcSetModifierMapping */
SendMappingNotify(MappingModifier, 0, 0, serverClient); SendMappingNotify(darwinKeyboard, MappingModifier, 0, 0, serverClient);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
if (pDev->key && pDev->coreEvents) if (pDev->key && pDev->coreEvents)
SendDeviceMappingNotify(serverClient, MappingModifier, 0, 0, pDev); SendDeviceMappingNotify(serverClient, MappingModifier, 0, 0, pDev);
@ -442,7 +442,7 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
assert(SetKeySymsMap(&pDev->key->curKeySyms, keySyms)); assert(SetKeySymsMap(&pDev->key->curKeySyms, keySyms));
SendMappingNotify(MappingKeyboard, keySyms->minKeyCode, SendMappingNotify(darwinKeyboard, MappingKeyboard, keySyms->minKeyCode,
keySyms->maxKeyCode - keySyms->minKeyCode + 1, serverClient); keySyms->maxKeyCode - keySyms->minKeyCode + 1, serverClient);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
if (pDev->key && pDev->coreEvents) if (pDev->key && pDev->coreEvents)
@ -477,7 +477,8 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
QuartzBell, DarwinChangeKeyboardControl)); QuartzBell, DarwinChangeKeyboardControl));
pthread_mutex_unlock(&keyInfo_mutex); pthread_mutex_unlock(&keyInfo_mutex);
SwitchCoreKeyboard(pDev); // TODO: What do we do now in 1.6?
//SwitchCoreKeyboard(pDev);
DarwinKeyboardSetDeviceKeyMap(&keySyms); DarwinKeyboardSetDeviceKeyMap(&keySyms);
} }

View File

@ -131,7 +131,7 @@ void QuartzReadPasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nev
event.u.selectionClear.time = GetTimeInMillis(); event.u.selectionClear.time = GetTimeInMillis();
event.u.selectionClear.window = pSel->window; event.u.selectionClear.window = pSel->window;
event.u.selectionClear.atom = pSel->selection; event.u.selectionClear.atom = pSel->selection;
TryClientEvents(pSel->client, &event, 1, NoEventMask, TryClientEvents(pSel->client, dev, &event, 1, NoEventMask,
NoEventMask /*CantBeFiltered*/, NullGrab); NoEventMask /*CantBeFiltered*/, NullGrab);
} }

View File

@ -185,7 +185,7 @@ load_cursor(CursorPtr src, int screen)
* Convert the X cursor representation to native format if possible. * Convert the X cursor representation to native format if possible.
*/ */
static Bool static Bool
QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) QuartzRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{ {
if(pCursor == NULL || pCursor->bits == NULL) if(pCursor == NULL || pCursor->bits == NULL)
return FALSE; return FALSE;
@ -201,7 +201,7 @@ QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* Free the storage space associated with a realized cursor. * Free the storage space associated with a realized cursor.
*/ */
static Bool static Bool
QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) QuartzUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{ {
return TRUE; return TRUE;
} }
@ -212,7 +212,7 @@ QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* Set the cursor sprite and position. * Set the cursor sprite and position.
*/ */
static void static void
QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y) QuartzSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{ {
QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen); QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
@ -245,16 +245,26 @@ QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
* Move the cursor. This is a noop for us. * Move the cursor. This is a noop for us.
*/ */
static void static void
QuartzMoveCursor(ScreenPtr pScreen, int x, int y) QuartzMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{ {
} }
/* TODO: New for 1.6 ... probably noop */
static Bool QuartzDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) {
return TRUE;
}
/* TODO: New for 1.6 ... probably noop */
static void QuartzDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) {
}
static miPointerSpriteFuncRec quartzSpriteFuncsRec = { static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
QuartzRealizeCursor, QuartzRealizeCursor,
QuartzUnrealizeCursor, QuartzUnrealizeCursor,
QuartzSetCursor, QuartzSetCursor,
QuartzMoveCursor QuartzMoveCursor,
QuartzDeviceCursorInitialize,
QuartzDeviceCursorCleanup
}; };
@ -293,7 +303,7 @@ QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
* *
*/ */
static void static void
QuartzWarpCursor(ScreenPtr pScreen, int x, int y) QuartzWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{ {
if (quartzServerVisible) if (quartzServerVisible)
{ {
@ -305,8 +315,8 @@ QuartzWarpCursor(ScreenPtr pScreen, int x, int y)
CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y)); CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y));
} }
miPointerWarpCursor(pScreen, x, y); miPointerWarpCursor(pDev, pScreen, x, y);
miPointerUpdate(); miPointerUpdateSprite(pDev);
} }
@ -404,13 +414,15 @@ QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
WindowPtr pWin; WindowPtr pWin;
CursorPtr pCursor; CursorPtr pCursor;
pWin = GetSpriteWindow(); /* TODO: Tablet? */
pWin = GetSpriteWindow(darwinPointer);
if (pWin->drawable.pScreen != pScreen) if (pWin->drawable.pScreen != pScreen)
return; return;
pCursor = GetSpriteCursor(); pCursor = GetSpriteCursor(darwinPointer);
if (pCursor == NULL) if (pCursor == NULL)
return; return;
QuartzSetCursor(pScreen, pCursor, x, y); QuartzSetCursor(darwinPointer, pScreen, pCursor, x, y);
} }