diff options
Diffstat (limited to 'xorg-server/Xi')
33 files changed, 348 insertions, 318 deletions
diff --git a/xorg-server/Xi/chgdctl.c b/xorg-server/Xi/chgdctl.c index d078aa248..106b9aaed 100644 --- a/xorg-server/Xi/chgdctl.c +++ b/xorg-server/Xi/chgdctl.c @@ -128,13 +128,12 @@ ProcXChangeDeviceControl(ClientPtr client) goto out; } - rep = (xChangeDeviceControlReply) { - .repType = X_Reply, - .RepType = X_ChangeDeviceControl, - .sequenceNumber = client->sequence, - .length = 0, - .status = Success, - }; + + rep.repType = X_Reply; + rep.RepType = X_ChangeDeviceControl; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.status = Success; switch (stuff->control) { case DEVICE_RESOLUTION: @@ -220,13 +219,12 @@ ProcXChangeDeviceControl(ClientPtr client) out: if (ret == Success) { - devicePresenceNotify dpn = { - .type = DevicePresenceNotify, - .time = currentTime.milliseconds, - .devchange = DeviceControlChanged, - .deviceid = dev->id, - .control = stuff->control - }; + devicePresenceNotify dpn; + dpn.type = DevicePresenceNotify; + dpn.time = currentTime.milliseconds; + dpn.devchange = DeviceControlChanged; + dpn.deviceid = dev->id; + dpn.control = stuff->control; SendEventToAllWindows(dev, DevicePresenceNotifyMask, (xEvent *) &dpn, 1); diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 4ed58eec4..90f49e43b 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -80,6 +80,8 @@ SOFTWARE. #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> +#else +#define XINPUT #endif #include "inputstr.h" @@ -1019,7 +1021,7 @@ DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti, err = EventToXI2(ev, &xi2); if (err != Success) FatalError("[Xi] %s: XI2 conversion failed in %s" - " (%d)\n", dev->name, __func__, err); + " (%d)\n", dev->name, __FUNCTION__, err); FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE); filter = GetEventFilter(dev, xi2); @@ -1644,7 +1646,7 @@ ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev) rc = EventToXI2(e, &ev); if (rc != Success) { - ErrorF("[Xi] event conversion from %s failed with code %d\n", __func__, rc); + ErrorF("[Xi] event conversion from %s failed with code %d\n", __FUNCTION__, rc); return; } @@ -1684,7 +1686,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) if (IsPointerDevice(device)) { kbd = GetMaster(device, KEYBOARD_OR_FLOAT); mouse = device; - if (!kbd->key) /* can happen with floating SDs */ + if (kbd && !kbd->key) /* can happen with floating SDs */ kbd = NULL; } else { @@ -1714,6 +1716,8 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) case ET_KeyRelease: case ET_ProximityIn: case ET_ProximityOut: + if (!device->spriteInfo->sprite) + return; GetSpritePosition(device, &rootX, &rootY); event->root_x = rootX; event->root_y = rootY; @@ -2537,6 +2541,10 @@ RecalculateDeviceDeliverableEvents(WindowPtr pWin) } } +#ifdef _MSC_VER +#pragma warning(disable:4715) /* Not all control paths return a value */ +#endif + int InputClientGone(WindowPtr pWin, XID id) { diff --git a/xorg-server/Xi/getbmap.c b/xorg-server/Xi/getbmap.c index 49b868889..78adc6623 100644 --- a/xorg-server/Xi/getbmap.c +++ b/xorg-server/Xi/getbmap.c @@ -92,13 +92,12 @@ ProcXGetDeviceButtonMapping(ClientPtr client) REQUEST(xGetDeviceButtonMappingReq); REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq); - rep = (xGetDeviceButtonMappingReply) { - .repType = X_Reply, - .RepType = X_GetDeviceButtonMapping, - .sequenceNumber = client->sequence, - .nElts = 0, - .length = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_GetDeviceButtonMapping; + rep.sequenceNumber = client->sequence; + rep.nElts = 0; + rep.length = 0; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) diff --git a/xorg-server/Xi/getdctl.c b/xorg-server/Xi/getdctl.c index 6f73e0979..39cde5174 100644 --- a/xorg-server/Xi/getdctl.c +++ b/xorg-server/Xi/getdctl.c @@ -182,12 +182,11 @@ ProcXGetDeviceControl(ClientPtr client) if (rc != Success) return rc; - rep = (xGetDeviceControlReply) { - .repType = X_Reply, - .RepType = X_GetDeviceControl, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_GetDeviceControl; + 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 599b2ef97..e235e7c1f 100644 --- a/xorg-server/Xi/getfctl.c +++ b/xorg-server/Xi/getfctl.c @@ -295,13 +295,12 @@ ProcXGetFeedbackControl(ClientPtr client) if (rc != Success) return rc; - rep = (xGetFeedbackControlReply) { - .repType = X_Reply, - .RepType = X_GetFeedbackControl, - .sequenceNumber = client->sequence, - .length = 0, - .num_feedbacks = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_GetFeedbackControl; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.num_feedbacks = 0; for (k = dev->kbdfeed; k; k = k->next) { rep.num_feedbacks++; diff --git a/xorg-server/Xi/getfocus.c b/xorg-server/Xi/getfocus.c index 40546cb84..9d6c42ccb 100644 --- a/xorg-server/Xi/getfocus.c +++ b/xorg-server/Xi/getfocus.c @@ -99,12 +99,11 @@ ProcXGetDeviceFocus(ClientPtr client) if (!dev->focus) return BadDevice; - rep = (xGetDeviceFocusReply) { - .repType = X_Reply, - .RepType = X_GetDeviceFocus, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_GetDeviceFocus; + rep.sequenceNumber = client->sequence; + rep.length = 0; focus = dev->focus; diff --git a/xorg-server/Xi/getkmap.c b/xorg-server/Xi/getkmap.c index 87c197759..2cb9b0978 100644 --- a/xorg-server/Xi/getkmap.c +++ b/xorg-server/Xi/getkmap.c @@ -119,13 +119,13 @@ ProcXGetDeviceKeyMapping(ClientPtr client) if (!syms) return BadAlloc; - rep = (xGetDeviceKeyMappingReply) { - .repType = X_Reply, - .RepType = X_GetDeviceKeyMapping, - .sequenceNumber = client->sequence, - .keySymsPerKeyCode = syms->mapWidth, - .length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */ - }; + + 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 */ + WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; diff --git a/xorg-server/Xi/getmmap.c b/xorg-server/Xi/getmmap.c index f07f2bb5c..6d55caa64 100644 --- a/xorg-server/Xi/getmmap.c +++ b/xorg-server/Xi/getmmap.c @@ -101,14 +101,13 @@ ProcXGetDeviceModifierMapping(ClientPtr client) if (ret != Success) return ret; - rep = (xGetDeviceModifierMappingReply) { - .repType = X_Reply, - .RepType = X_GetDeviceModifierMapping, - .sequenceNumber = client->sequence, - .numKeyPerModifier = max_keys_per_mod, + + rep.repType = X_Reply; + rep.RepType = X_GetDeviceModifierMapping; + rep.sequenceNumber = client->sequence; + rep.numKeyPerModifier = max_keys_per_mod; /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */ - .length = max_keys_per_mod << 1 - }; + rep.length = max_keys_per_mod << 1; WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); WriteToClient(client, max_keys_per_mod * 8, modkeymap); diff --git a/xorg-server/Xi/getprop.c b/xorg-server/Xi/getprop.c index 4d6ce6338..92ae57a1e 100644 --- a/xorg-server/Xi/getprop.c +++ b/xorg-server/Xi/getprop.c @@ -101,13 +101,12 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) REQUEST(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); - rep = (xGetDeviceDontPropagateListReply) { - .repType = X_Reply, - .RepType = X_GetDeviceDontPropagateList, - .sequenceNumber = client->sequence, - .length = 0, - .count = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_GetDeviceDontPropagateList; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.count = 0; rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) diff --git a/xorg-server/Xi/getselev.c b/xorg-server/Xi/getselev.c index 60a46c2d1..cc8bffb13 100644 --- a/xorg-server/Xi/getselev.c +++ b/xorg-server/Xi/getselev.c @@ -102,14 +102,13 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) REQUEST(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); - rep = (xGetSelectedExtensionEventsReply) { - .repType = X_Reply, - .RepType = X_GetSelectedExtensionEvents, - .sequenceNumber = client->sequence, - .length = 0, - .this_client_count = 0, - .all_clients_count = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_GetSelectedExtensionEvents; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.this_client_count = 0; + rep.all_clients_count = 0; rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) diff --git a/xorg-server/Xi/getvers.c b/xorg-server/Xi/getvers.c index 829e69535..5a1880d9c 100644 --- a/xorg-server/Xi/getvers.c +++ b/xorg-server/Xi/getvers.c @@ -98,15 +98,14 @@ ProcXGetExtensionVersion(ClientPtr client) stuff->nbytes)) return BadLength; - rep = (xGetExtensionVersionReply) { - .repType = X_Reply, - .RepType = X_GetExtensionVersion, - .sequenceNumber = client->sequence, - .length = 0, - .major_version = XIVersion.major_version, - .minor_version = XIVersion.minor_version, - .present = TRUE - }; + memset(&rep, 0, sizeof(xGetExtensionVersionReply)); + rep.repType = X_Reply; + rep.RepType = X_GetExtensionVersion; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.major_version = XIVersion.major_version; + rep.minor_version = XIVersion.minor_version; + rep.present = TRUE; WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep); diff --git a/xorg-server/Xi/grabdev.c b/xorg-server/Xi/grabdev.c index 090043814..dee5a4c45 100644 --- a/xorg-server/Xi/grabdev.c +++ b/xorg-server/Xi/grabdev.c @@ -113,12 +113,11 @@ ProcXGrabDevice(ClientPtr client) bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; - rep = (xGrabDeviceReply) { - .repType = X_Reply, - .RepType = X_GrabDevice, - .sequenceNumber = client->sequence, - .length = 0, - }; + + rep.repType = X_Reply; + rep.RepType = X_GrabDevice; + rep.sequenceNumber = client->sequence; + rep.length = 0; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (rc != Success) diff --git a/xorg-server/Xi/grabdevb.c b/xorg-server/Xi/grabdevb.c index 8b4ae698e..0f0e975a0 100644 --- a/xorg-server/Xi/grabdevb.c +++ b/xorg-server/Xi/grabdevb.c @@ -137,14 +137,13 @@ ProcXGrabDeviceButton(ClientPtr client) X_GrabDeviceButton)) != Success) return ret; - param = (GrabParameters) { - .grabtype = XI, - .ownerEvents = stuff->ownerEvents, - .this_device_mode = stuff->this_device_mode, - .other_devices_mode = stuff->other_devices_mode, - .grabWindow = stuff->grabWindow, - .modifiers = stuff->modifiers - }; + memset(¶m, 0, sizeof(param)); + param.grabtype = XI; + param.ownerEvents = stuff->ownerEvents; + param.this_device_mode = stuff->this_device_mode; + param.other_devices_mode = stuff->other_devices_mode; + param.grabWindow = stuff->grabWindow; + param.modifiers = stuff->modifiers; mask.xi = tmp[stuff->grabbed_device].mask; ret = GrabButton(client, dev, mdev, stuff->button, ¶m, XI, &mask); diff --git a/xorg-server/Xi/grabdevk.c b/xorg-server/Xi/grabdevk.c index 8694f9e6d..b75518211 100644 --- a/xorg-server/Xi/grabdevk.c +++ b/xorg-server/Xi/grabdevk.c @@ -135,14 +135,13 @@ ProcXGrabDeviceKey(ClientPtr client) X_GrabDeviceKey)) != Success) return ret; - param = (GrabParameters) { - .grabtype = XI, - .ownerEvents = stuff->ownerEvents, - .this_device_mode = stuff->this_device_mode, - .other_devices_mode = stuff->other_devices_mode, - .grabWindow = stuff->grabWindow, - .modifiers = stuff->modifiers - }; + memset(¶m, 0, sizeof(param)); + param.grabtype = XI; + param.ownerEvents = stuff->ownerEvents; + param.this_device_mode = stuff->this_device_mode; + param.other_devices_mode = stuff->other_devices_mode; + param.grabWindow = stuff->grabWindow; + param.modifiers = stuff->modifiers; mask.xi = tmp[stuff->grabbed_device].mask; ret = GrabKey(client, dev, mdev, stuff->key, ¶m, XI, &mask); diff --git a/xorg-server/Xi/gtmotion.c b/xorg-server/Xi/gtmotion.c index cde5351a6..1d39b2d1b 100644 --- a/xorg-server/Xi/gtmotion.c +++ b/xorg-server/Xi/gtmotion.c @@ -110,15 +110,15 @@ ProcXGetDeviceMotionEvents(ClientPtr client) if (dev->valuator->motionHintWindow) MaybeStopDeviceHint(dev, client); axes = v->numAxes; - rep = (xGetDeviceMotionEventsReply) { - .repType = X_Reply, - .RepType = X_GetDeviceMotionEvents, - .sequenceNumber = client->sequence, - .length = 0, - .nEvents = 0, - .axes = axes, - .mode = Absolute /* XXX we don't do relative at the moment */ - }; + + 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 */ + start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); if (CompareTimeStamps(start, stop) == LATER || diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c index 470fb52ee..e403a0cb5 100644 --- a/xorg-server/Xi/listdev.c +++ b/xorg-server/Xi/listdev.c @@ -342,12 +342,11 @@ ProcXListInputDevices(ClientPtr client) REQUEST_SIZE_MATCH(xListInputDevicesReq); - rep = (xListInputDevicesReply) { - .repType = X_Reply, - .RepType = X_ListInputDevices, - .sequenceNumber = client->sequence, - .length = 0 - }; + memset(&rep, 0, sizeof(xListInputDevicesReply)); + rep.repType = X_Reply; + rep.RepType = X_ListInputDevices; + rep.sequenceNumber = client->sequence; + rep.length = 0; /* allocate space for saving skip value */ skip = calloc(sizeof(Bool), inputInfo.numDevices); diff --git a/xorg-server/Xi/makefile b/xorg-server/Xi/makefile new file mode 100644 index 000000000..0c395d20e --- /dev/null +++ b/xorg-server/Xi/makefile @@ -0,0 +1,56 @@ +CSRCS=allowev.c \ + chgdctl.c \ + chgfctl.c \ + chgkbd.c \ + chgkmap.c \ + chgprop.c \ + chgptr.c \ + closedev.c \ + devbell.c \ + exevents.c \ + extinit.c \ + getbmap.c \ + getdctl.c \ + getfctl.c \ + getfocus.c \ + getkmap.c \ + getmmap.c \ + getprop.c \ + getselev.c \ + getvers.c \ + grabdev.c \ + grabdevb.c \ + grabdevk.c \ + gtmotion.c \ + listdev.c \ + opendev.c \ + queryst.c \ + selectev.c \ + sendexev.c \ + setbmap.c \ + setdval.c \ + setfocus.c \ + setmmap.c \ + setmode.c \ + ungrdev.c \ + ungrdevb.c \ + ungrdevk.c \ + xiallowev.c \ + xibarriers.c \ + xichangecursor.c \ + xichangehierarchy.c \ + xigetclientpointer.c \ + xigrabdev.c \ + xipassivegrab.c \ + xiproperty.c \ + xiquerydevice.c \ + xiquerypointer.c \ + xiqueryversion.c \ + xiselectev.c \ + xisetclientpointer.c \ + xisetdevfocus.c \ + xiwarppointer.c \ + stubs.c + +LIBRARY=libXi + diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c index 6708bade1..f3cb9a463 100644 --- a/xorg-server/Xi/opendev.c +++ b/xorg-server/Xi/opendev.c @@ -114,9 +114,6 @@ ProcXOpenDevice(ClientPtr client) if (IsMaster(dev)) return BadDevice; - if (status != Success) - return status; - if (dev->key != NULL) { evbase[j].class = KeyClass; evbase[j++].event_type_base = event_base[KeyClass]; @@ -144,13 +141,12 @@ ProcXOpenDevice(ClientPtr client) } evbase[j].class = OtherClass; evbase[j++].event_type_base = event_base[OtherClass]; - rep = (xOpenDeviceReply) { - .repType = X_Reply, - .RepType = X_OpenDevice, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(j * sizeof(xInputClassInfo)), - .num_classes = j - }; + 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), evbase); return Success; diff --git a/xorg-server/Xi/queryst.c b/xorg-server/Xi/queryst.c index 04a652be3..6b1f015c2 100644 --- a/xorg-server/Xi/queryst.c +++ b/xorg-server/Xi/queryst.c @@ -158,13 +158,13 @@ ProcXQueryDeviceState(ClientPtr client) } } - rep = (xQueryDeviceStateReply) { - .repType = X_Reply, - .RepType = X_QueryDeviceState, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(total_length), - .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); diff --git a/xorg-server/Xi/setbmap.c b/xorg-server/Xi/setbmap.c index 94796558d..4f0f4ab9d 100644 --- a/xorg-server/Xi/setbmap.c +++ b/xorg-server/Xi/setbmap.c @@ -100,13 +100,12 @@ ProcXSetDeviceButtonMapping(ClientPtr client) if (ret != Success) return ret; - rep = (xSetDeviceButtonMappingReply) { - .repType = X_Reply, - .RepType = X_SetDeviceButtonMapping, - .sequenceNumber = client->sequence, - .length = 0, - .status = MappingSuccess - }; + + rep.repType = X_Reply; + rep.RepType = X_SetDeviceButtonMapping; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.status = MappingSuccess; ret = ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length, diff --git a/xorg-server/Xi/setdval.c b/xorg-server/Xi/setdval.c index 463e4f38c..1e2e59772 100644 --- a/xorg-server/Xi/setdval.c +++ b/xorg-server/Xi/setdval.c @@ -92,13 +92,12 @@ ProcXSetDeviceValuators(ClientPtr client) REQUEST(xSetDeviceValuatorsReq); REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq); - rep = (xSetDeviceValuatorsReply) { - .repType = X_Reply, - .RepType = X_SetDeviceValuators, - .sequenceNumber = client->sequence, - .length = 0, - .status = Success - }; + + rep.repType = X_Reply; + rep.RepType = X_SetDeviceValuators; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.status = Success; if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) + stuff->num_valuators) diff --git a/xorg-server/Xi/setmmap.c b/xorg-server/Xi/setmmap.c index 1320cfec7..0e6027f54 100644 --- a/xorg-server/Xi/setmmap.c +++ b/xorg-server/Xi/setmmap.c @@ -98,12 +98,11 @@ ProcXSetDeviceModifierMapping(ClientPtr client) (stuff->numKeyPerModifier << 1)) return BadLength; - rep = (xSetDeviceModifierMappingReply) { - .repType = X_Reply, - .RepType = X_SetDeviceModifierMapping, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_SetDeviceModifierMapping; + rep.sequenceNumber = client->sequence; + rep.length = 0; ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) diff --git a/xorg-server/Xi/setmode.c b/xorg-server/Xi/setmode.c index 5ed09136e..a57cc7b08 100644 --- a/xorg-server/Xi/setmode.c +++ b/xorg-server/Xi/setmode.c @@ -92,12 +92,11 @@ ProcXSetDeviceMode(ClientPtr client) REQUEST(xSetDeviceModeReq); REQUEST_SIZE_MATCH(xSetDeviceModeReq); - rep = (xSetDeviceModeReply) { - .repType = X_Reply, - .RepType = X_SetDeviceMode, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_SetDeviceMode; + rep.sequenceNumber = client->sequence; + rep.length = 0; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) diff --git a/xorg-server/Xi/xibarriers.c b/xorg-server/Xi/xibarriers.c index a8b92cc18..8f277601d 100644 --- a/xorg-server/Xi/xibarriers.c +++ b/xorg-server/Xi/xibarriers.c @@ -398,19 +398,18 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen, struct PointerBarrier *nearest = NULL; PointerBarrierClientPtr c; Time ms = GetTimeInMillis(); - BarrierEvent ev = { - .header = ET_Internal, - .type = 0, - .length = sizeof (BarrierEvent), - .time = ms, - .deviceid = dev->id, - .sourceid = dev->id, - .dx = dest_x - current_x, - .dy = dest_y - current_y, - .root = screen->root->drawable.id, - }; InternalEvent *barrier_events = events; DeviceIntPtr master; + BarrierEvent ev; + ev.header = ET_Internal; + ev.type = 0; + ev.length = sizeof (BarrierEvent); + ev.time = ms; + ev.deviceid = dev->id; + ev.sourceid = dev->id; + ev.dx = dest_x - current_x; + ev.dy = dest_y - current_y; + ev.root = screen->root->drawable.id; if (nevents) *nevents = 0; @@ -651,24 +650,24 @@ BarrierFreeBarrier(void *data, XID id) for (dev = inputInfo.devices; dev; dev = dev->next) { struct PointerBarrierDevice *pbd; int root_x, root_y; - BarrierEvent ev = { - .header = ET_Internal, - .type = ET_BarrierLeave, - .length = sizeof (BarrierEvent), - .time = ms, - /* .deviceid */ - .sourceid = 0, - .barrierid = c->id, - .window = c->window, - .root = screen->root->drawable.id, - .dx = 0, - .dy = 0, - /* .root_x */ - /* .root_y */ - /* .dt */ - /* .event_id */ - .flags = XIBarrierPointerReleased, - }; + BarrierEvent ev; + ev.header = ET_Internal; + ev.type = ET_BarrierLeave; + ev.length = sizeof (BarrierEvent); + ev.time = ms; + /* .deviceid */ + ev.sourceid = 0; + ev.barrierid = c->id; + ev.window = c->window; + ev.root = screen->root->drawable.id; + ev.dx = 0; + ev.dy = 0; + /* .root_x */ + /* .root_y */ + /* .dt */ + /* .event_id */ + ev.flags = XIBarrierPointerReleased; + if (dev->type != MASTER_POINTER) @@ -732,22 +731,22 @@ static void remove_master_func(void *res, XID id, void *devid) pbd = GetBarrierDevice(barrier, *deviceid); if (pbd->hit) { - BarrierEvent ev = { - .header = ET_Internal, - .type =ET_BarrierLeave, - .length = sizeof (BarrierEvent), - .time = ms, - .deviceid = *deviceid, - .sourceid = 0, - .dx = 0, - .dy = 0, - .root = barrier->screen->root->drawable.id, - .window = barrier->window, - .dt = ms - pbd->last_timestamp, - .flags = XIBarrierPointerReleased, - .event_id = pbd->barrier_event_id, - .barrierid = barrier->id, - }; + BarrierEvent ev; + ev.header = ET_Internal; + ev.type =ET_BarrierLeave; + ev.length = sizeof (BarrierEvent); + ev.time = ms; + ev.deviceid = *deviceid; + ev.sourceid = 0; + ev.dx = 0; + ev.dy = 0; + ev.root = barrier->screen->root->drawable.id; + ev.window = barrier->window; + ev.dt = ms - pbd->last_timestamp; + ev.flags = XIBarrierPointerReleased; + ev.event_id = pbd->barrier_event_id; + ev.barrierid = barrier->id; + mieqEnqueue(dev, (InternalEvent *) &ev); } diff --git a/xorg-server/Xi/xigetclientpointer.c b/xorg-server/Xi/xigetclientpointer.c index 3c90d588d..6ab2867f7 100644 --- a/xorg-server/Xi/xigetclientpointer.c +++ b/xorg-server/Xi/xigetclientpointer.c @@ -75,14 +75,13 @@ ProcXIGetClientPointer(ClientPtr client) else winclient = client; - rep = (xXIGetClientPointerReply) { - .repType = X_Reply, - .RepType = X_XIGetClientPointer, - .sequenceNumber = client->sequence, - .length = 0, - .set = (winclient->clientPtr != NULL), - .deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_XIGetClientPointer; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.set = (winclient->clientPtr != NULL); + rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0; WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep); return Success; diff --git a/xorg-server/Xi/xigrabdev.c b/xorg-server/Xi/xigrabdev.c index 63d95bc1c..086e275d8 100644 --- a/xorg-server/Xi/xigrabdev.c +++ b/xorg-server/Xi/xigrabdev.c @@ -115,13 +115,12 @@ ProcXIGrabDevice(ClientPtr client) if (ret != Success) return ret; - rep = (xXIGrabDeviceReply) { - .repType = X_Reply, - .RepType = X_XIGrabDevice, - .sequenceNumber = client->sequence, - .length = 0, - .status = status - }; + + rep.repType = X_Reply; + rep.RepType = X_XIGrabDevice; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.status = status; WriteReplyToClient(client, sizeof(rep), &rep); return ret; diff --git a/xorg-server/Xi/xipassivegrab.c b/xorg-server/Xi/xipassivegrab.c index 8aba97781..0e37e0e1b 100644 --- a/xorg-server/Xi/xipassivegrab.c +++ b/xorg-server/Xi/xipassivegrab.c @@ -76,13 +76,7 @@ int ProcXIPassiveGrabDevice(ClientPtr client) { DeviceIntPtr dev, mod_dev; - xXIPassiveGrabDeviceReply rep = { - .repType = X_Reply, - .RepType = X_XIPassiveGrabDevice, - .sequenceNumber = client->sequence, - .length = 0, - .num_modifiers = 0 - }; + xXIPassiveGrabDeviceReply rep; int i, ret = Success; uint32_t *modifiers; xXIGrabModifierInfo *modifiers_failed; @@ -94,6 +88,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) diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c index 463607d33..18936c587 100644 --- a/xorg-server/Xi/xiproperty.c +++ b/xorg-server/Xi/xiproperty.c @@ -185,23 +185,23 @@ static void send_property_event(DeviceIntPtr dev, Atom property, int what) { int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue; - devicePropertyNotify event = { - .type = DevicePropertyNotify, - .deviceid = dev->id, - .state = state, - .atom = property, - .time = currentTime.milliseconds - }; - xXIPropertyEvent xi2 = { - .type = GenericEvent, - .extension = IReqCode, - .length = 0, - .evtype = XI_PropertyEvent, - .deviceid = dev->id, - .time = currentTime.milliseconds, - .property = property, - .what = what - }; + xXIPropertyEvent xi2; devicePropertyNotify event; + event.type = DevicePropertyNotify; + event.deviceid = dev->id; + event.state = state; + event.atom = property; + event.time = currentTime.milliseconds; + + + xi2.type = GenericEvent; + xi2.extension = IReqCode; + xi2.length = 0; + xi2.evtype = XI_PropertyEvent; + xi2.deviceid = dev->id; + xi2.time = currentTime.milliseconds; + xi2.property = property; + xi2.what = what; + SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1); @@ -865,13 +865,12 @@ ProcXListDeviceProperties(ClientPtr client) if (rc != Success) return rc; - rep = (xListDevicePropertiesReply) { - .repType = X_Reply, - .RepType = X_ListDeviceProperties, - .sequenceNumber = client->sequence, - .length = natoms, - .nAtoms = natoms - }; + + rep.repType = X_Reply; + rep.RepType = X_ListDeviceProperties; + rep.sequenceNumber = client->sequence; + rep.length = natoms; + rep.nAtoms = natoms; WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep); if (natoms) { @@ -961,17 +960,16 @@ ProcXGetDeviceProperty(ClientPtr client) if (rc != Success) return rc; - reply = (xGetDevicePropertyReply) { - .repType = X_Reply, - .RepType = X_GetDeviceProperty, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(length), - .propertyType = type, - .bytesAfter = bytes_after, - .nItems = nitems, - .format = format, - .deviceid = dev->id - }; + + reply.repType = X_Reply; + reply.RepType = X_GetDeviceProperty; + reply.sequenceNumber = client->sequence; + reply.length = bytes_to_int32(length); + reply.propertyType = type; + reply.bytesAfter = bytes_after; + reply.nItems = nitems; + reply.format = format; + reply.deviceid = dev->id; if (stuff->delete && (reply.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1105,13 +1103,12 @@ ProcXIListProperties(ClientPtr client) if (rc != Success) return rc; - rep = (xXIListPropertiesReply) { - .repType = X_Reply, - .RepType = X_XIListProperties, - .sequenceNumber = client->sequence, - .length = natoms, - .num_properties = natoms - }; + + rep.repType = X_Reply; + rep.RepType = X_XIListProperties; + rep.sequenceNumber = client->sequence; + rep.length = natoms; + rep.num_properties = natoms; WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep); if (natoms) { @@ -1201,16 +1198,15 @@ ProcXIGetProperty(ClientPtr client) if (rc != Success) return rc; - reply = (xXIGetPropertyReply) { - .repType = X_Reply, - .RepType = X_XIGetProperty, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(length), - .type = type, - .bytes_after = bytes_after, - .num_items = nitems, - .format = format - }; + + 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; if (length && stuff->delete && (reply.bytes_after == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c index 4e544f0f5..1d1090046 100644 --- a/xorg-server/Xi/xiquerydevice.c +++ b/xorg-server/Xi/xiquerydevice.c @@ -107,13 +107,12 @@ ProcXIQueryDevice(ClientPtr client) return BadAlloc; } - rep = (xXIQueryDeviceReply) { - .repType = X_Reply, - .RepType = X_XIQueryDevice, - .sequenceNumber = client->sequence, - .length = len / 4, - .num_devices = 0 - }; + memset(&rep, 0, sizeof(xXIQueryDeviceReply)); + rep.repType = X_Reply; + rep.RepType = X_XIQueryDevice; + rep.sequenceNumber = client->sequence; + rep.length = len / 4; + rep.num_devices = 0; ptr = info; if (dev) { diff --git a/xorg-server/Xi/xiquerypointer.c b/xorg-server/Xi/xiquerypointer.c index e9bdd428d..a87326181 100644 --- a/xorg-server/Xi/xiquerypointer.c +++ b/xorg-server/Xi/xiquerypointer.c @@ -122,16 +122,15 @@ ProcXIQueryPointer(ClientPtr client) pSprite = pDev->spriteInfo->sprite; - rep = (xXIQueryPointerReply) { - .repType = X_Reply, - .RepType = X_XIQueryPointer, - .sequenceNumber = client->sequence, - .length = 6, - .root = (GetCurrentRootWindow(pDev))->drawable.id, - .root_x = double_to_fp1616(pSprite->hot.x), - .root_y = double_to_fp1616(pSprite->hot.y), - .child = None - }; + memset(&rep, 0, sizeof(rep)); + rep.repType = X_Reply; + rep.RepType = X_XIQueryPointer; + rep.sequenceNumber = client->sequence; + rep.length = 6; + rep.root = (GetCurrentRootWindow(pDev))->drawable.id; + rep.root_x = double_to_fp1616(pSprite->hot.x); + rep.root_y = double_to_fp1616(pSprite->hot.y); + rep.child = None; if (kbd) { state = &kbd->key->xkbInfo->state; diff --git a/xorg-server/Xi/xiqueryversion.c b/xorg-server/Xi/xiqueryversion.c index c705f788f..cb23415a1 100644 --- a/xorg-server/Xi/xiqueryversion.c +++ b/xorg-server/Xi/xiqueryversion.c @@ -114,14 +114,13 @@ ProcXIQueryVersion(ClientPtr client) pXIClient->minor_version = minor; } - rep = (xXIQueryVersionReply) { - .repType = X_Reply, - .RepType = X_XIQueryVersion, - .sequenceNumber = client->sequence, - .length = 0, - .major_version = major, - .minor_version = minor - }; + memset(&rep, 0, sizeof(xXIQueryVersionReply)); + rep.repType = X_Reply; + rep.RepType = X_XIQueryVersion; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.major_version = major; + rep.minor_version = minor; WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep); diff --git a/xorg-server/Xi/xiselectev.c b/xorg-server/Xi/xiselectev.c index 45a996e4c..8592747f6 100644 --- a/xorg-server/Xi/xiselectev.c +++ b/xorg-server/Xi/xiselectev.c @@ -297,13 +297,12 @@ ProcXIGetSelectedEvents(ClientPtr client) if (rc != Success) return rc; - reply = (xXIGetSelectedEventsReply) { - .repType = X_Reply, - .RepType = X_XIGetSelectedEvents, - .sequenceNumber = client->sequence, - .length = 0, - .num_masks = 0 - }; + + reply.repType = X_Reply; + reply.RepType = X_XIGetSelectedEvents; + reply.sequenceNumber = client->sequence; + reply.length = 0; + reply.num_masks = 0; masks = wOtherInputMasks(win); if (masks) { diff --git a/xorg-server/Xi/xisetdevfocus.c b/xorg-server/Xi/xisetdevfocus.c index 372ec248a..aec822c6b 100644 --- a/xorg-server/Xi/xisetdevfocus.c +++ b/xorg-server/Xi/xisetdevfocus.c @@ -97,12 +97,11 @@ ProcXIGetFocus(ClientPtr client) if (!dev->focus) return BadDevice; - rep = (xXIGetFocusReply) { - .repType = X_Reply, - .RepType = X_XIGetFocus, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.repType = X_Reply; + rep.RepType = X_XIGetFocus; + rep.sequenceNumber = client->sequence; + rep.length = 0; if (dev->focus->win == NoneWin) rep.focus = None; |