diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-11-28 09:22:04 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-12-01 08:16:57 +1000 |
commit | be4bf65d00a28cc77b939f00f115528a9024ab89 (patch) | |
tree | d068f1468914c95cef23ab0015e45b5d6f7b8d3a /dix | |
parent | aba1cbaadcde50a7a25f8aee06b66eec67a9145e (diff) |
input: don't switch MDs' classes around between SDs.
Server 1.6 uses the X Input 1.x input model, where the core devices (VCP and
VCK) do not generate XI events. They don't have to swap device classes but
instead stay at the default number of classes at all times.
This means we can get rid of the DeviceClassesChangedEvents as well.
Diffstat (limited to 'dix')
-rw-r--r-- | dix/devices.c | 20 | ||||
-rw-r--r-- | dix/getevents.c | 44 |
2 files changed, 0 insertions, 64 deletions
diff --git a/dix/devices.c b/dix/devices.c index f85e875af..f7fef95ab 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2568,26 +2568,6 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) for (it = inputInfo.devices; it; it = it->next) if (!it->isMaster && it->u.master == oldmaster) break; - - if (!it) /* no dev is paired with old master */ - { - /* XXX: reset to defaults */ - EventList event = { NULL, 0}; - char* classbuf; - - /* Send event to clients */ - CreateClassesChangedEvent(&event, oldmaster, oldmaster); - deviceClassesChangedEvent *dcce = - (deviceClassesChangedEvent*)event.event; - dcce->deviceid = oldmaster->id; - dcce->num_classes = 0; - classbuf = (char*)&event.event[1]; - CopySwapClasses(NullClient, oldmaster, - &dcce->num_classes, &classbuf); - SendEventToAllWindows(oldmaster, XI_DeviceClassesChangedMask, - event.event, 1); - xfree(event.event); - } } return Success; diff --git a/dix/getevents.c b/dix/getevents.c index 620ce937d..82be5e9bc 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -60,7 +60,6 @@ #include "exevents.h" #include "exglobals.h" #include "extnsionst.h" -#include "listdev.h" /* for sizing up DeviceClassesChangedEvent */ /* Maximum number of valuators, divided by six, rounded up, to get number * of events. */ @@ -117,43 +116,6 @@ key_autorepeats(DeviceIntPtr pDev, int key_code) (1 << (key_code & 7))); } -void -CreateClassesChangedEvent(EventList* event, - DeviceIntPtr master, - DeviceIntPtr slave) -{ - deviceClassesChangedEvent *dcce; - int len = sizeof(xEvent); - CARD32 ms = GetTimeInMillis(); - int namelen = 0; /* dummy */ - - /* XXX: ok, this is a bit weird. We need to alloc enough size for the - * event so it can be filled in in POE lateron. Reason being that if - * we realloc the event in POE we can get SIGABRT when we try to free - * or realloc the original pointer. - * We can only do it here as we don't have the EventList in the event - * processing any more. - */ - SizeDeviceInfo(slave, &namelen, &len); - - if (event->evlen < len) - { - event->event = realloc(event->event, len); - if (!event->event) - FatalError("[dix] Cannot allocate memory for " - "DeviceClassesChangedEvent.\n"); - event->evlen = len; - } - - dcce = (deviceClassesChangedEvent*)event->event; - dcce->type = GenericEvent; - dcce->extension = IReqCode; - dcce->evtype = XI_DeviceClassesChangedNotify; - dcce->time = ms; - dcce->new_slave = slave->id; - dcce->length = (len - sizeof(xEvent))/4; -} - /** * Rescale the coord between the two axis ranges. */ @@ -580,12 +542,9 @@ updateFromMaster(EventListPtr events, DeviceIntPtr dev, int *num_events) DeviceIntPtr master = dev->u.master; if (master && master->u.lastSlave != dev) { - CreateClassesChangedEvent(events, master, dev); updateSlaveDeviceCoords(master, dev); master->u.lastSlave = dev; master->last.numValuators = dev->last.numValuators; - (*num_events)++; - events++; } return events; } @@ -1104,12 +1063,9 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, master = pDev->u.master; if (master && master->u.lastSlave != pDev) { - CreateClassesChangedEvent(events, master, pDev); updateSlaveDeviceCoords(master, pDev); master->u.lastSlave = pDev; master->last.numValuators = pDev->last.numValuators; - num_events++; - events++; } kbp = (deviceKeyButtonPointer *) events->event; |