Input: change processing API to InternalEvents.
Don't pass xEvent* and count through to processing, pass a single InternalEvent. Custom handlers are disabled for the time being. And for extra fun, XKB's pointer motion emulation is disabled. But stick an error in there so that we get reminded should we forget about it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0b4066c116
commit
763848d3ab
|
@ -876,7 +876,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
|
|||
*
|
||||
*/
|
||||
void
|
||||
ProcessOtherEvent(xEventPtr ev, DeviceIntPtr device, int count)
|
||||
ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||
{
|
||||
GrabPtr grab = device->deviceGrab.grab;
|
||||
Bool deactivateDeviceGrab = FALSE;
|
||||
|
|
|
@ -1028,7 +1028,7 @@ NoticeEventTime(InternalEvent *ev)
|
|||
* linked list for later delivery.
|
||||
*/
|
||||
void
|
||||
EnqueueEvent(xEvent *ev, DeviceIntPtr device, int count)
|
||||
EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||
{
|
||||
QdEventPtr tail = *syncEvents.pendtail;
|
||||
QdEventPtr qe;
|
||||
|
@ -1163,7 +1163,7 @@ PlayReleasedEvents(void)
|
|||
|
||||
}
|
||||
#endif
|
||||
(*qe->device->public.processInputProc)(qe->event, qe->device, 1);
|
||||
(*qe->device->public.processInputProc)(qe->event, qe->device);
|
||||
xfree(qe);
|
||||
for (dev = inputInfo.devices; dev && dev->deviceGrab.sync.frozen; dev = dev->next)
|
||||
;
|
||||
|
|
|
@ -328,9 +328,8 @@ extern _X_EXPORT WindowPtr GetSpriteWindow(DeviceIntPtr pDev);
|
|||
extern _X_EXPORT void NoticeEventTime(InternalEvent *ev);
|
||||
|
||||
extern _X_EXPORT void EnqueueEvent(
|
||||
xEventPtr /* xE */,
|
||||
DeviceIntPtr /* device */,
|
||||
int /* count */);
|
||||
InternalEvent * /* ev */,
|
||||
DeviceIntPtr /* device */);
|
||||
|
||||
extern _X_EXPORT void ActivatePointerGrab(
|
||||
DeviceIntPtr /* mouse */,
|
||||
|
|
|
@ -51,9 +51,8 @@ UpdateDeviceState (
|
|||
DeviceEvent* /* xE */);
|
||||
|
||||
extern _X_EXPORT void ProcessOtherEvent (
|
||||
xEventPtr /* FIXME deviceKeyButtonPointer * xE */,
|
||||
DeviceIntPtr /* other */,
|
||||
int /* count */);
|
||||
InternalEvent* /* ev */,
|
||||
DeviceIntPtr /* other */);
|
||||
|
||||
extern _X_EXPORT int InitProximityClassDeviceStruct(
|
||||
DeviceIntPtr /* dev */);
|
||||
|
|
|
@ -96,6 +96,7 @@ SOFTWARE.
|
|||
#define RevertToFollowKeyboard 3
|
||||
#endif
|
||||
|
||||
#include "events.h"
|
||||
|
||||
typedef unsigned long Leds;
|
||||
typedef struct _OtherClients *OtherClientsPtr;
|
||||
|
@ -122,9 +123,8 @@ typedef int (*DeviceProc)(
|
|||
int /*what*/);
|
||||
|
||||
typedef void (*ProcessInputProc)(
|
||||
xEventPtr /*events*/,
|
||||
DeviceIntPtr /*device*/,
|
||||
int /*count*/);
|
||||
InternalEvent * /*event*/,
|
||||
DeviceIntPtr /*device*/);
|
||||
|
||||
typedef Bool (*DeviceHandleProc)(
|
||||
DeviceIntPtr /*device*/,
|
||||
|
@ -379,14 +379,12 @@ extern _X_EXPORT void MaybeStopHint(
|
|||
ClientPtr /*client*/);
|
||||
|
||||
extern _X_EXPORT void ProcessPointerEvent(
|
||||
xEventPtr /*xE*/,
|
||||
DeviceIntPtr /*mouse*/,
|
||||
int /*count*/);
|
||||
InternalEvent* /* ev */,
|
||||
DeviceIntPtr /*mouse*/);
|
||||
|
||||
extern _X_EXPORT void ProcessKeyboardEvent(
|
||||
xEventPtr /*xE*/,
|
||||
DeviceIntPtr /*keybd*/,
|
||||
int /*count*/);
|
||||
InternalEvent* /*ev*/,
|
||||
DeviceIntPtr /*keybd*/);
|
||||
|
||||
extern _X_EXPORT Bool LegalModifier(
|
||||
unsigned int /*key*/,
|
||||
|
|
|
@ -391,6 +391,7 @@ mieqProcessInputEvents(void)
|
|||
|
||||
/* If someone's registered a custom event handler, let them
|
||||
* steal it. */
|
||||
#if 0
|
||||
if (handler)
|
||||
{
|
||||
/* FIXME: this is broken now, InternalEvents! */
|
||||
|
@ -399,12 +400,15 @@ mieqProcessInputEvents(void)
|
|||
handler(DequeueScreen(master)->myNum,
|
||||
masterEvents->event, master, 1);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* process slave first, then master */
|
||||
dev->public.processInputProc(event, dev, 1);
|
||||
dev->public.processInputProc(event, dev);
|
||||
|
||||
if (master)
|
||||
master->public.processInputProc(masterEvents->event, master, 1);
|
||||
master->public.processInputProc(
|
||||
(InternalEvent*)masterEvents->event,
|
||||
master);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,9 @@ DeviceIntPtr master = NULL;
|
|||
if (dev == inputInfo.pointer || !dev->public.on)
|
||||
return;
|
||||
|
||||
ErrorF("[xkb] XkbDDXFakeDeviceButton. If you read this message in your "
|
||||
"log file, Please file a bug on bugs.freedesktop.org.\n");
|
||||
#if 0
|
||||
nAxes = (dev->valuator?dev->valuator->numAxes:0);
|
||||
if (nAxes > 6)
|
||||
nAxes = 6;
|
||||
|
@ -125,4 +128,5 @@ DeviceIntPtr master = NULL;
|
|||
(*master->public.processInputProc)(masterEvents->event, master, count);
|
||||
}
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -684,16 +684,15 @@ Bool ignoreKeyEvent = FALSE;
|
|||
extern int xkbDevicePrivateIndex;
|
||||
extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer);
|
||||
void
|
||||
ProcessPointerEvent( register xEvent * xE,
|
||||
register DeviceIntPtr mouse,
|
||||
int count)
|
||||
ProcessPointerEvent( InternalEvent *ev,
|
||||
DeviceIntPtr mouse)
|
||||
{
|
||||
DeviceIntPtr dev = GetPairedDevice(mouse);
|
||||
XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
|
||||
unsigned changed = 0;
|
||||
ProcessInputProc backupproc;
|
||||
xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
|
||||
DeviceEvent *event = (DeviceEvent*)xE;
|
||||
DeviceEvent *event = (DeviceEvent*)ev;
|
||||
|
||||
xkbi->shiftKeyCount = 0;
|
||||
xkbi->lastPtrEventTime= event->time;
|
||||
|
@ -723,7 +722,7 @@ DeviceEvent *event = (DeviceEvent*)xE;
|
|||
*/
|
||||
|
||||
UNWRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc);
|
||||
mouse->public.processInputProc(xE, mouse, count);
|
||||
mouse->public.processInputProc(ev, mouse);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr,
|
||||
backupproc, xkbUnwrapProc);
|
||||
|
||||
|
|
|
@ -853,7 +853,7 @@ ProcessInputProc backupproc;
|
|||
}
|
||||
|
||||
UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc);
|
||||
xkbi->device->public.processInputProc(&ev,xkbi->device,1);
|
||||
xkbi->device->public.processInputProc((InternalEvent*)&ev, xkbi->device);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr,
|
||||
backupproc,xkbUnwrapProc);
|
||||
|
||||
|
@ -884,7 +884,7 @@ ProcessInputProc backupproc;
|
|||
}
|
||||
|
||||
UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc);
|
||||
xkbi->device->public.processInputProc(&ev,xkbi->device,1);
|
||||
xkbi->device->public.processInputProc((InternalEvent*)&ev, xkbi->device);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr,
|
||||
backupproc,xkbUnwrapProc);
|
||||
|
||||
|
@ -1212,7 +1212,7 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
|
|||
tmpdev = GetPairedDevice(dev);
|
||||
|
||||
UNWRAP_PROCESS_INPUT_PROC(tmpdev,xkbPrivPtr, backupproc);
|
||||
dev->public.processInputProc((xEvent*)event, tmpdev, 1);
|
||||
dev->public.processInputProc((InternalEvent*)event, tmpdev);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(tmpdev, xkbPrivPtr,
|
||||
backupproc,xkbUnwrapProc);
|
||||
}
|
||||
|
|
|
@ -161,14 +161,14 @@ unsigned ndx;
|
|||
}
|
||||
|
||||
void
|
||||
ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count)
|
||||
ProcessKeyboardEvent(InternalEvent *ev, DeviceIntPtr keybd)
|
||||
{
|
||||
|
||||
KeyClassPtr keyc = keybd->key;
|
||||
XkbSrvInfoPtr xkbi = NULL;
|
||||
ProcessInputProc backup_proc;
|
||||
xkbDeviceInfoPtr xkb_priv = XKBDEVICEINFO(keybd);
|
||||
DeviceEvent *event = (DeviceEvent*)xE;
|
||||
DeviceEvent *event = (DeviceEvent*)ev;
|
||||
int is_press = (event->type == ET_KeyPress);
|
||||
int is_release = (event->type == ET_KeyRelease);
|
||||
|
||||
|
@ -178,7 +178,7 @@ ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count)
|
|||
/* We're only interested in key events. */
|
||||
if (!is_press && !is_release) {
|
||||
UNWRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc);
|
||||
keybd->public.processInputProc(xE, keybd, count);
|
||||
keybd->public.processInputProc(ev, keybd);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc,
|
||||
xkbUnwrapProc);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user