XQuartz: Updated some code to use newer server API

This commit is contained in:
Jeremy Huddleston 2008-11-22 13:57:45 -08:00
parent 6eb33bc0cb
commit 8e2287c220
5 changed files with 16 additions and 16 deletions

View File

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

View File

@ -345,7 +345,6 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) {
// Set button map.
InitPointerDeviceStruct((DevicePtr)pPointer, map, 7,
GetMotionHistory,
(PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), 2);
InitAbsoluteClassDeviceStruct(pPointer);
@ -376,7 +375,6 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) {
// Set button map.
InitPointerDeviceStruct((DevicePtr)pPointer, map, 3,
GetMotionHistory,
(PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), 5);
pPointer->valuator->mode = Absolute; // Relative
@ -477,7 +475,7 @@ int DarwinParseModifierList(const char *constmodifiers, int separatelr)
*/
void InitInput( int argc, char **argv )
{
darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
RegisterKeyboardDevice( darwinKeyboard );
darwinKeyboard->name = strdup("keyboard");
@ -495,19 +493,19 @@ void InitInput( int argc, char **argv )
gdkdev->info.source = GDK_SOURCE_PEN;
*/
darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE);
RegisterPointerDevice( darwinPointer );
darwinPointer->name = strdup("pointer");
darwinTabletStylus = AddInputDevice(DarwinTabletProc, TRUE);
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
RegisterPointerDevice( darwinTabletStylus );
darwinTabletStylus->name = strdup("pen");
darwinTabletCursor = AddInputDevice(DarwinTabletProc, TRUE);
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
RegisterPointerDevice( darwinTabletCursor );
darwinTabletCursor->name = strdup("cursor");
darwinTabletEraser = AddInputDevice(DarwinTabletProc, TRUE);
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
RegisterPointerDevice( darwinTabletEraser );
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_t fd_add_tid = NULL;
static xEvent *darwinEvents = NULL;
static EventList *darwinEvents = NULL;
static pthread_mutex_t mieq_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t mieq_ready_cond = PTHREAD_COND_INITIALIZER;
@ -324,7 +324,7 @@ Bool DarwinEQInit(void) {
* here, so I don't bother.
*/
if (!darwinEvents) {
darwinEvents = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum());
darwinEvents = InitEventList(GetMaximumEventsNum());;
if (!darwinEvents)
FatalError("Couldn't allocate event buffer\n");
@ -450,7 +450,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
darwinEvents_lock(); {
num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button,
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();
} darwinEvents_unlock();
}
@ -465,7 +465,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) {
darwinEvents_lock(); {
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();
} darwinEvents_unlock();
}
@ -493,7 +493,7 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) {
darwinEvents_lock(); {
num_events = GetProximityEvents(darwinEvents, dev, ev_type,
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();
} darwinEvents_unlock();
}

View File

@ -432,7 +432,7 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
DeviceIntPtr pDev;
/* From ProcSetModifierMapping */
SendMappingNotify(MappingModifier, 0, 0, serverClient);
SendMappingNotify(darwinKeyboard, MappingModifier, 0, 0, serverClient);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
if (pDev->key && pDev->coreEvents)
SendDeviceMappingNotify(serverClient, MappingModifier, 0, 0, pDev);
@ -442,7 +442,7 @@ static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
assert(SetKeySymsMap(&pDev->key->curKeySyms, keySyms));
SendMappingNotify(MappingKeyboard, keySyms->minKeyCode,
SendMappingNotify(darwinKeyboard, MappingKeyboard, keySyms->minKeyCode,
keySyms->maxKeyCode - keySyms->minKeyCode + 1, serverClient);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
if (pDev->key && pDev->coreEvents)
@ -477,7 +477,8 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
QuartzBell, DarwinChangeKeyboardControl));
pthread_mutex_unlock(&keyInfo_mutex);
SwitchCoreKeyboard(pDev);
// TODO: What do we do now in 1.6?
//SwitchCoreKeyboard(pDev);
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.window = pSel->window;
event.u.selectionClear.atom = pSel->selection;
TryClientEvents(pSel->client, &event, 1, NoEventMask,
TryClientEvents(pSel->client, dev, &event, 1, NoEventMask,
NoEventMask /*CantBeFiltered*/, NullGrab);
}