diff options
author | marha <marha@users.sourceforge.net> | 2012-07-11 11:55:48 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-07-11 11:55:48 +0200 |
commit | 6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab (patch) | |
tree | 21e1af7ee94600e349ae21353dc11963a06e988d /xorg-server/Xi | |
parent | 75f57cf199b6c042b0f7515e3a1ab80f7ccecfab (diff) | |
parent | d137057fd13e83ec15ab416c7fe774741da06047 (diff) | |
download | vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.tar.gz vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.tar.bz2 vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/Xext/shm.c
xorg-server/Xext/sync.c
xorg-server/Xext/xf86bigfont.c
xorg-server/Xi/opendev.c
xorg-server/dix/dispatch.c
xorg-server/include/globals.h
xorg-server/mi/miinitext.c
Diffstat (limited to 'xorg-server/Xi')
30 files changed, 127 insertions, 109 deletions
diff --git a/xorg-server/Xi/chgdctl.c b/xorg-server/Xi/chgdctl.c index ff5d69aef..ec5975981 100644 --- a/xorg-server/Xi/chgdctl.c +++ b/xorg-server/Xi/chgdctl.c @@ -113,7 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client) AxisInfoPtr a; CARD32 *resolution; xDeviceEnableCtl *e; - devicePresenceNotify dpn; REQUEST(xChangeDeviceControlReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); @@ -123,10 +122,11 @@ ProcXChangeDeviceControl(ClientPtr client) if (ret != Success) goto out; + rep.repType = X_Reply; rep.RepType = X_ChangeDeviceControl; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; switch (stuff->control) { case DEVICE_RESOLUTION: @@ -209,6 +209,7 @@ ProcXChangeDeviceControl(ClientPtr client) out: if (ret == Success) { + devicePresenceNotify dpn; dpn.type = DevicePresenceNotify; dpn.time = currentTime.milliseconds; dpn.devchange = DeviceControlChanged; @@ -236,5 +237,5 @@ SRepXChangeDeviceControl(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 7d7974400..93129b30b 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -1268,7 +1268,7 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, else ti->listeners[0].state = LISTENER_HAS_ACCEPTED; } - else { /* this is the very first ownership event for a grab */ + else { /* this is the very first ownership event for a grab */ DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource); } } @@ -2316,12 +2316,11 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client, check = (mask & exclusivemasks); if (wOtherInputMasks(pWin)) { - if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) { /* It is illegal for two different - * clients to select on any of the - * events for maskcheck. However, - * it is OK, for some client to - * continue selecting on one of those - * events. */ + if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) { + /* It is illegal for two different clients to select on any of + * the events for maskcheck. However, it is OK, for some client + * to continue selecting on one of those events. + */ for (others = wOtherInputMasks(pWin)->inputClients; others; others = others->next) { if (!SameClient(others, client) && (check & diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c index 94f46f72f..eac2586ed 100644 --- a/xorg-server/Xi/extinit.c +++ b/xorg-server/Xi/extinit.c @@ -49,8 +49,6 @@ SOFTWARE. * Dispatch routines and initialization routines for the X input extension. * */ -#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) - #define NUMTYPES 15 #ifdef HAVE_DIX_CONFIG_H @@ -150,10 +148,8 @@ const Mask ChangeDeviceNotifyMask = (1L << 16); const Mask DeviceButtonGrabMask = (1L << 17); const Mask DeviceOwnerGrabButtonMask = (1L << 17); const Mask DevicePresenceNotifyMask = (1L << 18); -const Mask DeviceEnterWindowMask = (1L << 18); -const Mask DeviceLeaveWindowMask = (1L << 19); -const Mask DevicePropertyNotifyMask = (1L << 20); -const Mask XIAllMasks = (1L << 21) - 1; +const Mask DevicePropertyNotifyMask = (1L << 19); +const Mask XIAllMasks = (1L << 20) - 1; int ExtEventIndex; Mask ExtExclusiveMasks[EMASKSIZE]; @@ -438,8 +434,9 @@ SProcIDispatch(ClientPtr client) static void SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) - /* All we look at is the type field */ -{ /* This is common to all replies */ +{ + /* All we look at is the type field */ + /* This is common to all replies */ if (rep->RepType == X_GetExtensionVersion) SRepXGetExtensionVersion(client, len, (xGetExtensionVersionReply *) rep); diff --git a/xorg-server/Xi/getbmap.c b/xorg-server/Xi/getbmap.c index a0ec1a61b..78adc6623 100644 --- a/xorg-server/Xi/getbmap.c +++ b/xorg-server/Xi/getbmap.c @@ -92,11 +92,12 @@ ProcXGetDeviceButtonMapping(ClientPtr client) REQUEST(xGetDeviceButtonMappingReq); REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq); + rep.repType = X_Reply; rep.RepType = X_GetDeviceButtonMapping; + rep.sequenceNumber = client->sequence; rep.nElts = 0; rep.length = 0; - rep.sequenceNumber = client->sequence; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) @@ -109,7 +110,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client) rep.nElts = b->numButtons; rep.length = bytes_to_int32(rep.nElts); WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep); - (void) WriteToClient(client, rep.nElts, (char *) &b->map[1]); + WriteToClient(client, rep.nElts, &b->map[1]); return Success; } @@ -126,5 +127,5 @@ SRepXGetDeviceButtonMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/getdctl.c b/xorg-server/Xi/getdctl.c index 4d66a4dfc..39cde5174 100644 --- a/xorg-server/Xi/getdctl.c +++ b/xorg-server/Xi/getdctl.c @@ -158,7 +158,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /*********************************************************************** @@ -182,10 +182,11 @@ ProcXGetDeviceControl(ClientPtr client) if (rc != Success) return rc; + rep.repType = X_Reply; rep.RepType = X_GetDeviceControl; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; switch (stuff->control) { case DEVICE_RESOLUTION: diff --git a/xorg-server/Xi/getfctl.c b/xorg-server/Xi/getfctl.c index 2772c0c26..e235e7c1f 100644 --- a/xorg-server/Xi/getfctl.c +++ b/xorg-server/Xi/getfctl.c @@ -265,7 +265,7 @@ SRepXGetFeedbackControl(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_feedbacks); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /*********************************************************************** @@ -295,10 +295,11 @@ ProcXGetFeedbackControl(ClientPtr client) if (rc != Success) return rc; + rep.repType = X_Reply; rep.RepType = X_GetFeedbackControl; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.num_feedbacks = 0; for (k = dev->kbdfeed; k; k = k->next) { diff --git a/xorg-server/Xi/getfocus.c b/xorg-server/Xi/getfocus.c index ba36e37e3..9d6c42ccb 100644 --- a/xorg-server/Xi/getfocus.c +++ b/xorg-server/Xi/getfocus.c @@ -99,10 +99,11 @@ ProcXGetDeviceFocus(ClientPtr client) if (!dev->focus) return BadDevice; + rep.repType = X_Reply; rep.RepType = X_GetDeviceFocus; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; focus = dev->focus; @@ -135,5 +136,5 @@ SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep) swapl(&rep->length); swapl(&rep->focus); swapl(&rep->time); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/getkmap.c b/xorg-server/Xi/getkmap.c index 006be62a6..2cb9b0978 100644 --- a/xorg-server/Xi/getkmap.c +++ b/xorg-server/Xi/getkmap.c @@ -119,11 +119,13 @@ ProcXGetDeviceKeyMapping(ClientPtr client) if (!syms) return BadAlloc; + rep.repType = X_Reply; rep.RepType = X_GetDeviceKeyMapping; rep.sequenceNumber = client->sequence; rep.keySymsPerKeyCode = syms->mapWidth; - rep.length = (syms->mapWidth * stuff->count); /* KeySyms are 4 bytes */ + rep.length = (syms->mapWidth * stuff->count); /* KeySyms are 4 bytes */ + WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; @@ -150,5 +152,5 @@ SRepXGetDeviceKeyMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/getmmap.c b/xorg-server/Xi/getmmap.c index 3f8424373..6d55caa64 100644 --- a/xorg-server/Xi/getmmap.c +++ b/xorg-server/Xi/getmmap.c @@ -101,15 +101,16 @@ ProcXGetDeviceModifierMapping(ClientPtr client) if (ret != Success) return ret; + rep.repType = X_Reply; rep.RepType = X_GetDeviceModifierMapping; - rep.numKeyPerModifier = max_keys_per_mod; rep.sequenceNumber = client->sequence; + rep.numKeyPerModifier = max_keys_per_mod; /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */ rep.length = max_keys_per_mod << 1; WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); - WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap); + WriteToClient(client, max_keys_per_mod * 8, modkeymap); free(modkeymap); @@ -129,5 +130,5 @@ SRepXGetDeviceModifierMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/getprop.c b/xorg-server/Xi/getprop.c index b7b9e6b5a..92ae57a1e 100644 --- a/xorg-server/Xi/getprop.c +++ b/xorg-server/Xi/getprop.c @@ -101,6 +101,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) REQUEST(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); + rep.repType = X_Reply; rep.RepType = X_GetDeviceDontPropagateList; rep.sequenceNumber = client->sequence; @@ -178,5 +179,5 @@ SRepXGetDeviceDontPropagateList(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->count); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/getselev.c b/xorg-server/Xi/getselev.c index 253c87fb5..cc8bffb13 100644 --- a/xorg-server/Xi/getselev.c +++ b/xorg-server/Xi/getselev.c @@ -102,10 +102,11 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) REQUEST(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); + rep.repType = X_Reply; rep.RepType = X_GetSelectedExtensionEvents; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.this_client_count = 0; rep.all_clients_count = 0; @@ -170,5 +171,5 @@ SRepXGetSelectedExtensionEvents(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->this_client_count); swaps(&rep->all_clients_count); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/getvers.c b/xorg-server/Xi/getvers.c index eb52c5b93..5a1880d9c 100644 --- a/xorg-server/Xi/getvers.c +++ b/xorg-server/Xi/getvers.c @@ -101,11 +101,11 @@ ProcXGetExtensionVersion(ClientPtr client) memset(&rep, 0, sizeof(xGetExtensionVersionReply)); rep.repType = X_Reply; rep.RepType = X_GetExtensionVersion; - rep.length = 0; rep.sequenceNumber = client->sequence; - rep.present = TRUE; + rep.length = 0; rep.major_version = XIVersion.major_version; rep.minor_version = XIVersion.minor_version; + rep.present = TRUE; WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep); @@ -127,5 +127,5 @@ SRepXGetExtensionVersion(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/grabdev.c b/xorg-server/Xi/grabdev.c index c904a9707..52cdb1b7b 100644 --- a/xorg-server/Xi/grabdev.c +++ b/xorg-server/Xi/grabdev.c @@ -113,6 +113,7 @@ ProcXGrabDevice(ClientPtr client) bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; + rep.repType = X_Reply; rep.RepType = X_GrabDevice; rep.sequenceNumber = client->sequence; @@ -211,5 +212,5 @@ SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/gtmotion.c b/xorg-server/Xi/gtmotion.c index 48bc79af4..7c73e0b9c 100644 --- a/xorg-server/Xi/gtmotion.c +++ b/xorg-server/Xi/gtmotion.c @@ -110,13 +110,15 @@ ProcXGetDeviceMotionEvents(ClientPtr client) if (dev->valuator->motionHintWindow) MaybeStopDeviceHint(dev, client); axes = v->numAxes; + rep.repType = X_Reply; rep.RepType = X_GetDeviceMotionEvents; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.nEvents = 0; rep.axes = axes; rep.mode = Absolute; /* XXX we don't do relative at the moment */ - rep.length = 0; + start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); if (CompareTimeStamps(start, stop) == LATER || @@ -147,7 +149,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) bufptr++; } } - WriteToClient(client, length * 4, (char *) coords); + WriteToClient(client, length * 4, coords); } free(coords); return Success; @@ -167,5 +169,5 @@ SRepXGetDeviceMotionEvents(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->nEvents); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c index a02112f32..bccfe35d1 100644 --- a/xorg-server/Xi/listdev.c +++ b/xorg-server/Xi/listdev.c @@ -345,8 +345,8 @@ ProcXListInputDevices(ClientPtr client) memset(&rep, 0, sizeof(xListInputDevicesReply)); rep.repType = X_Reply; rep.RepType = X_ListInputDevices; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; /* allocate space for saving skip value */ skip = calloc(sizeof(Bool), inputInfo.numDevices); @@ -417,5 +417,5 @@ SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c index 27a959d85..f3cb9a463 100644 --- a/xorg-server/Xi/opendev.c +++ b/xorg-server/Xi/opendev.c @@ -114,10 +114,6 @@ ProcXOpenDevice(ClientPtr client) if (IsMaster(dev)) return BadDevice; - memset(&rep, 0, sizeof(xOpenDeviceReply)); - rep.repType = X_Reply; - rep.RepType = X_OpenDevice; - rep.sequenceNumber = client->sequence; if (dev->key != NULL) { evbase[j].class = KeyClass; evbase[j++].event_type_base = event_base[KeyClass]; @@ -145,10 +141,14 @@ ProcXOpenDevice(ClientPtr client) } evbase[j].class = OtherClass; evbase[j++].event_type_base = event_base[OtherClass]; + memset(&rep, 0, sizeof(xOpenDeviceReply)); + rep.repType = X_Reply; + rep.RepType = X_OpenDevice; + rep.sequenceNumber = client->sequence; rep.length = bytes_to_int32(j * sizeof(xInputClassInfo)); rep.num_classes = j; WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep); - WriteToClient(client, j * sizeof(xInputClassInfo), (char *) evbase); + WriteToClient(client, j * sizeof(xInputClassInfo), evbase); return Success; } @@ -164,5 +164,5 @@ SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/queryst.c b/xorg-server/Xi/queryst.c index ffb6de04a..6b1f015c2 100644 --- a/xorg-server/Xi/queryst.c +++ b/xorg-server/Xi/queryst.c @@ -87,11 +87,6 @@ ProcXQueryDeviceState(ClientPtr client) REQUEST(xQueryDeviceStateReq); REQUEST_SIZE_MATCH(xQueryDeviceStateReq); - rep.repType = X_Reply; - rep.RepType = X_QueryDeviceState; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); if (rc != Success && rc != BadAccess) return rc; @@ -163,8 +158,13 @@ ProcXQueryDeviceState(ClientPtr client) } } - rep.num_classes = num_classes; + + rep.repType = X_Reply; + rep.RepType = X_QueryDeviceState; + rep.sequenceNumber = client->sequence; rep.length = bytes_to_int32(total_length); + rep.num_classes = num_classes; + WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep); if (total_length > 0) WriteToClient(client, total_length, savbuf); @@ -184,5 +184,5 @@ SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/setbmap.c b/xorg-server/Xi/setbmap.c index 110f5e91e..4f0f4ab9d 100644 --- a/xorg-server/Xi/setbmap.c +++ b/xorg-server/Xi/setbmap.c @@ -100,10 +100,11 @@ ProcXSetDeviceButtonMapping(ClientPtr client) if (ret != Success) return ret; + rep.repType = X_Reply; rep.RepType = X_SetDeviceButtonMapping; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.status = MappingSuccess; ret = @@ -134,5 +135,5 @@ SRepXSetDeviceButtonMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/setdval.c b/xorg-server/Xi/setdval.c index 542f20dd8..79f3d2ab4 100644 --- a/xorg-server/Xi/setdval.c +++ b/xorg-server/Xi/setdval.c @@ -92,11 +92,12 @@ ProcXSetDeviceValuators(ClientPtr client) REQUEST(xSetDeviceValuatorsReq); REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq); + rep.repType = X_Reply; rep.RepType = X_SetDeviceValuators; + rep.sequenceNumber = client->sequence; rep.length = 0; rep.status = Success; - rep.sequenceNumber = client->sequence; if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) + stuff->num_valuators) @@ -138,5 +139,5 @@ SRepXSetDeviceValuators(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/setmmap.c b/xorg-server/Xi/setmmap.c index 36845d706..0e6027f54 100644 --- a/xorg-server/Xi/setmmap.c +++ b/xorg-server/Xi/setmmap.c @@ -98,10 +98,11 @@ ProcXSetDeviceModifierMapping(ClientPtr client) (stuff->numKeyPerModifier << 1)) return BadLength; + rep.repType = X_Reply; rep.RepType = X_SetDeviceModifierMapping; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) @@ -140,5 +141,5 @@ SRepXSetDeviceModifierMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/setmode.c b/xorg-server/Xi/setmode.c index a7bf1eaff..df3880d11 100644 --- a/xorg-server/Xi/setmode.c +++ b/xorg-server/Xi/setmode.c @@ -92,10 +92,11 @@ ProcXSetDeviceMode(ClientPtr client) REQUEST(xSetDeviceModeReq); REQUEST_SIZE_MATCH(xSetDeviceModeReq); + rep.repType = X_Reply; rep.RepType = X_SetDeviceMode; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) @@ -137,5 +138,5 @@ SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/xigetclientpointer.c b/xorg-server/Xi/xigetclientpointer.c index 07dbf1800..6ab2867f7 100644 --- a/xorg-server/Xi/xigetclientpointer.c +++ b/xorg-server/Xi/xigetclientpointer.c @@ -75,10 +75,11 @@ ProcXIGetClientPointer(ClientPtr client) else winclient = client; + rep.repType = X_Reply; rep.RepType = X_XIGetClientPointer; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.set = (winclient->clientPtr != NULL); rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0; @@ -100,5 +101,5 @@ SRepXIGetClientPointer(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->deviceid); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/xigrabdev.c b/xorg-server/Xi/xigrabdev.c index 8d2cf0bed..a4344be4a 100644 --- a/xorg-server/Xi/xigrabdev.c +++ b/xorg-server/Xi/xigrabdev.c @@ -104,10 +104,11 @@ ProcXIGrabDevice(ClientPtr client) if (ret != Success) return ret; + rep.repType = X_Reply; rep.RepType = X_XIGrabDevice; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.status = status; WriteReplyToClient(client, sizeof(rep), &rep); @@ -156,5 +157,5 @@ SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/xipassivegrab.c b/xorg-server/Xi/xipassivegrab.c index 7130328ec..59cde7f17 100644 --- a/xorg-server/Xi/xipassivegrab.c +++ b/xorg-server/Xi/xipassivegrab.c @@ -90,6 +90,12 @@ ProcXIPassiveGrabDevice(ClientPtr client) REQUEST(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); + rep.repType = X_Reply; + rep.RepType = X_XIPassiveGrabDevice; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.num_modifiers = 0; + if (stuff->deviceid == XIAllDevices) dev = inputInfo.all_devices; else if (stuff->deviceid == XIAllMasterDevices) @@ -137,12 +143,6 @@ ProcXIPassiveGrabDevice(ClientPtr client) xi2mask_set_one_mask(mask.xi2mask, stuff->deviceid, (unsigned char *) &stuff[1], mask_len * 4); - rep.repType = X_Reply; - rep.RepType = X_XIPassiveGrabDevice; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.num_modifiers = 0; - memset(¶m, 0, sizeof(param)); param.grabtype = XI2; param.ownerEvents = stuff->owner_events; @@ -224,7 +224,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) WriteReplyToClient(client, sizeof(rep), &rep); if (rep.num_modifiers) - WriteToClient(client, rep.length * 4, (char *) modifiers_failed); + WriteToClient(client, rep.length * 4, modifiers_failed); free(modifiers_failed); out: @@ -240,7 +240,7 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->num_modifiers); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } int diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c index 5f46b5435..86429c1d9 100644 --- a/xorg-server/Xi/xiproperty.c +++ b/xorg-server/Xi/xiproperty.c @@ -182,21 +182,14 @@ static long XIPropHandlerID = 1; static void send_property_event(DeviceIntPtr dev, Atom property, int what) { - devicePropertyNotify event; - xXIPropertyEvent xi2; - int state; - - if (what == XIPropertyDeleted) - state = PropertyDelete; - else - state = PropertyNewValue; - + int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue; + xXIPropertyEvent xi2; devicePropertyNotify event; event.type = DevicePropertyNotify; event.deviceid = dev->id; event.state = state; event.atom = property; event.time = currentTime.milliseconds; - SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1); + xi2.type = GenericEvent; xi2.extension = IReqCode; @@ -206,6 +199,10 @@ send_property_event(DeviceIntPtr dev, Atom property, int what) xi2.time = currentTime.milliseconds; xi2.property = property; xi2.what = what; + + + SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1); + SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2), (xEvent *) &xi2, 1); } @@ -864,10 +861,11 @@ ProcXListDeviceProperties(ClientPtr client) if (rc != Success) return rc; + rep.repType = X_Reply; rep.RepType = X_ListDeviceProperties; - rep.length = natoms; rep.sequenceNumber = client->sequence; + rep.length = natoms; rep.nAtoms = natoms; WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep); @@ -958,15 +956,16 @@ ProcXGetDeviceProperty(ClientPtr client) if (rc != Success) return rc; + reply.repType = X_Reply; reply.RepType = X_GetDeviceProperty; reply.sequenceNumber = client->sequence; - reply.deviceid = dev->id; + reply.length = bytes_to_int32(length); + reply.propertyType = type; + reply.bytesAfter = bytes_after; reply.nItems = nitems; reply.format = format; - reply.bytesAfter = bytes_after; - reply.propertyType = type; - reply.length = bytes_to_int32(length); + reply.deviceid = dev->id; if (stuff->delete && (reply.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1063,7 +1062,7 @@ SRepXListDeviceProperties(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->nAtoms); /* properties will be swapped later, see ProcXListDeviceProperties */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } void @@ -1076,7 +1075,7 @@ SRepXGetDeviceProperty(ClientPtr client, int size, swapl(&rep->bytesAfter); swapl(&rep->nItems); /* data will be swapped, see ProcXGetDeviceProperty */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /* XI2 Request/reply handling */ @@ -1100,10 +1099,11 @@ ProcXIListProperties(ClientPtr client) if (rc != Success) return rc; + rep.repType = X_Reply; rep.RepType = X_XIListProperties; - rep.length = natoms; rep.sequenceNumber = client->sequence; + rep.length = natoms; rep.num_properties = natoms; WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep); @@ -1194,14 +1194,15 @@ ProcXIGetProperty(ClientPtr client) if (rc != Success) return rc; + reply.repType = X_Reply; reply.RepType = X_XIGetProperty; reply.sequenceNumber = client->sequence; + reply.length = bytes_to_int32(length); + reply.type = type; + reply.bytes_after = bytes_after; reply.num_items = nitems; reply.format = format; - reply.bytes_after = bytes_after; - reply.type = type; - reply.length = bytes_to_int32(length); if (length && stuff->delete && (reply.bytes_after == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1300,7 +1301,7 @@ SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep) swapl(&rep->length); swaps(&rep->num_properties); /* properties will be swapped later, see ProcXIListProperties */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } void @@ -1312,5 +1313,5 @@ SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep) swapl(&rep->bytes_after); swapl(&rep->num_items); /* data will be swapped, see ProcXIGetProperty */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c index 15c8b2a7b..af7ea5394 100644 --- a/xorg-server/Xi/xiquerydevice.c +++ b/xorg-server/Xi/xiquerydevice.c @@ -162,7 +162,7 @@ SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep) /* Device info is already swapped, see ProcXIQueryDevice */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /** diff --git a/xorg-server/Xi/xiquerypointer.c b/xorg-server/Xi/xiquerypointer.c index 169436e14..8c1876aa4 100644 --- a/xorg-server/Xi/xiquerypointer.c +++ b/xorg-server/Xi/xiquerypointer.c @@ -124,8 +124,8 @@ ProcXIQueryPointer(ClientPtr client) memset(&rep, 0, sizeof(rep)); rep.repType = X_Reply; rep.RepType = X_XIQueryPointer; - rep.length = 6; rep.sequenceNumber = client->sequence; + rep.length = 6; rep.root = (GetCurrentRootWindow(pDev))->drawable.id; rep.root_x = FP1616(pSprite->hot.x, 0); rep.root_y = FP1616(pSprite->hot.y, 0); @@ -219,5 +219,5 @@ SRepXIQueryPointer(ClientPtr client, int size, xXIQueryPointerReply * rep) swapl(&rep->win_y); swaps(&rep->buttons_len); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/xiqueryversion.c b/xorg-server/Xi/xiqueryversion.c index 6081c413d..057d019be 100644 --- a/xorg-server/Xi/xiqueryversion.c +++ b/xorg-server/Xi/xiqueryversion.c @@ -96,8 +96,8 @@ ProcXIQueryVersion(ClientPtr client) memset(&rep, 0, sizeof(xXIQueryVersionReply)); rep.repType = X_Reply; rep.RepType = X_XIQueryVersion; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.major_version = major; rep.minor_version = minor; @@ -126,5 +126,5 @@ SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep) swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xorg-server/Xi/xiselectev.c b/xorg-server/Xi/xiselectev.c index e7e719d16..0e753c60f 100644 --- a/xorg-server/Xi/xiselectev.c +++ b/xorg-server/Xi/xiselectev.c @@ -260,10 +260,11 @@ ProcXIGetSelectedEvents(ClientPtr client) if (rc != Success) return rc; + reply.repType = X_Reply; reply.RepType = X_XIGetSelectedEvents; - reply.length = 0; reply.sequenceNumber = client->sequence; + reply.length = 0; reply.num_masks = 0; masks = wOtherInputMasks(win); @@ -335,5 +336,5 @@ SRepXIGetSelectedEvents(ClientPtr client, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_masks); - WriteToClient(client, len, (char *) rep); + WriteToClient(client, len, rep); } diff --git a/xorg-server/Xi/xisetdevfocus.c b/xorg-server/Xi/xisetdevfocus.c index b52c9cc99..aec822c6b 100644 --- a/xorg-server/Xi/xisetdevfocus.c +++ b/xorg-server/Xi/xisetdevfocus.c @@ -97,10 +97,11 @@ ProcXIGetFocus(ClientPtr client) if (!dev->focus) return BadDevice; + rep.repType = X_Reply; rep.RepType = X_XIGetFocus; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; if (dev->focus->win == NoneWin) rep.focus = None; @@ -121,5 +122,5 @@ SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply * rep) swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->focus); - WriteToClient(client, len, (char *) rep); + WriteToClient(client, len, rep); } |