Fixed pointer events in Xquartz -- Keyboard events work, but
the keycodes are incorrect.
This commit is contained in:
parent
39ecd6fff4
commit
2dafc46e3d
|
@ -867,7 +867,8 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
|||
int valuators[2];
|
||||
float count;
|
||||
xEvent xe;
|
||||
|
||||
char nullbyte=0;
|
||||
|
||||
bzero(&xe, sizeof(xe));
|
||||
input_check_flag++;
|
||||
|
||||
|
@ -886,10 +887,10 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
|||
pointer_y = (screen.origin.y + screen.size.height) - location.y;
|
||||
}
|
||||
|
||||
ErrorF("send_nsevent: type=%d pointer=(%d,%d)\n", type, pointer_x, pointer_y);
|
||||
// ErrorF("send_nsevent: type=%d pointer=(%d,%d)\n", type, pointer_x, pointer_y);
|
||||
|
||||
valuators[0] = pointer_x;
|
||||
valuators[1] = pointer_y;
|
||||
valuators[1] = pointer_y - aquaMenuBarHeight;
|
||||
state = convert_flags ([e modifierFlags]);
|
||||
|
||||
switch (type) {
|
||||
|
@ -916,12 +917,8 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
|||
num_events = GetPointerEvents(quartzEvents, darwinPointer, ev_type, ev_button,
|
||||
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||
|
||||
ErrorF("GetPointerEvents returned %d events\n", num_events);
|
||||
for(i=0; i<num_events; i++) {
|
||||
ErrorF("qe[%d].u.u.type=%d\n", i, quartzEvents[i].u.u.type);
|
||||
// quartzEvents[i].u.keyButtonPointer.state = state;
|
||||
for(i=0; i<num_events; i++)
|
||||
mieqEnqueue (darwinPointer,&quartzEvents[i]);
|
||||
}
|
||||
break;
|
||||
case NSScrollWheel:
|
||||
count = [e deltaY];
|
||||
|
@ -929,28 +926,23 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
|||
for (count = fabs(count); count > 0.0; count = count - 1.0f) {
|
||||
num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonPress, ev_button,
|
||||
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||
for(i=0; i<num_events; i++) {
|
||||
// quartzEvents[i].u.keyButtonPointer.state = state;
|
||||
for(i=0; i<num_events; i++)
|
||||
mieqEnqueue(darwinPointer,&quartzEvents[i]);
|
||||
}
|
||||
num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonRelease, ev_button,
|
||||
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||
for(i=0; i<num_events; i++) {
|
||||
// quartzEvents[i].u.keyButtonPointer.state = state;
|
||||
for(i=0; i<num_events; i++)
|
||||
mieqEnqueue(darwinPointer,&quartzEvents[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NSKeyDown:
|
||||
case NSKeyDown: // do we need to translate these keyCodes?
|
||||
case NSKeyUp:
|
||||
num_events = GetKeyboardEvents(quartzEvents, darwinKeyboard,
|
||||
(type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
|
||||
for(i=0; i<num_events; i++) {
|
||||
// quartzEvents[i].u.keyButtonPointer.state = state;
|
||||
for(i=0; i<num_events; i++)
|
||||
mieqEnqueue(darwinKeyboard,&quartzEvents[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case NSFlagsChanged:
|
||||
xe.u.u.type = kXDarwinUpdateModifiers;
|
||||
xe.u.clientMessage.u.l.longs0 = [e modifierFlags];
|
||||
|
@ -958,5 +950,6 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
|||
break;
|
||||
default: break; /* for gcc */
|
||||
}
|
||||
// UpdateCurrentTime();
|
||||
// <daniels> bushing: oh, i ... er ... christ.
|
||||
write(darwinEventWriteFD, &nullbyte, 1);
|
||||
}
|
||||
|
|
|
@ -446,7 +446,11 @@ ProcAppleWMSetWindowMenu(
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef INXQUARTZ
|
||||
X11ApplicationSetWindowMenu (nitems, items, shortcuts);
|
||||
#else
|
||||
QuartzSetWindowMenu (nitems, items, shortcuts);
|
||||
#endif
|
||||
|
||||
free(items);
|
||||
free(shortcuts);
|
||||
|
@ -462,10 +466,12 @@ ProcAppleWMSetWindowMenuCheck(
|
|||
REQUEST(xAppleWMSetWindowMenuCheckReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
|
||||
|
||||
#ifdef INXQUARTZ
|
||||
X11ApplicationSetWindowMenuCheck(stuff->index);
|
||||
#else
|
||||
QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index,
|
||||
sizeof(stuff->index));
|
||||
|
||||
#endif
|
||||
return (client->noClientException);
|
||||
}
|
||||
|
||||
|
@ -475,9 +481,11 @@ ProcAppleWMSetFrontProcess(
|
|||
)
|
||||
{
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
|
||||
|
||||
#ifdef INXQUARTZ
|
||||
X11ApplicationSetFrontProcess();
|
||||
#else
|
||||
QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0);
|
||||
|
||||
#endif
|
||||
return (client->noClientException);
|
||||
}
|
||||
|
||||
|
@ -516,9 +524,12 @@ ProcAppleWMSetCanQuit(
|
|||
REQUEST(xAppleWMSetCanQuitReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
|
||||
|
||||
#ifdef INXQUARTZ
|
||||
X11ApplicationSetCanQuit(stuff->state);
|
||||
#else
|
||||
QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state,
|
||||
sizeof(stuff->state));
|
||||
#endif
|
||||
|
||||
return (client->noClientException);
|
||||
}
|
||||
|
|
|
@ -160,7 +160,11 @@ void DarwinModeInitInput(
|
|||
int argc,
|
||||
char **argv )
|
||||
{
|
||||
#ifdef INXQUARTZ
|
||||
X11ApplicationServerReady();
|
||||
#else
|
||||
QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
|
||||
#endif
|
||||
|
||||
// Do final display mode specific initialization before handling events
|
||||
if (quartzProcs->InitInput)
|
||||
|
@ -274,7 +278,9 @@ static void QuartzHide(void)
|
|||
}
|
||||
}
|
||||
quartzServerVisible = FALSE;
|
||||
#ifndef INXQUARTZ
|
||||
QuartzMessageMainThread(kQuartzServerHidden, NULL, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,9 @@ static pthread_cond_t cursorCondition;
|
|||
/* Acquire lock and tell the main thread to change cursor */ \
|
||||
pthread_mutex_lock(&cursorMutex); \
|
||||
currentCursor = (CCrsrHandle) (cursorH); \
|
||||
#ifndef INXQUARTZ
|
||||
QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
|
||||
#endif
|
||||
\
|
||||
/* Wait for the main thread to change the cursor */ \
|
||||
pthread_cond_wait(&cursorCondition, &cursorMutex); \
|
||||
|
|
Loading…
Reference in New Issue
Block a user