diff options
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r-- | xorg-server/xkb/XKBMisc.c | 2 | ||||
-rw-r--r-- | xorg-server/xkb/ddxPrivate.c | 32 | ||||
-rw-r--r-- | xorg-server/xkb/makefile | 42 | ||||
-rw-r--r-- | xorg-server/xkb/xkb.c | 321 | ||||
-rw-r--r-- | xorg-server/xkb/xkbActions.c | 5 | ||||
-rw-r--r-- | xorg-server/xkb/xkbEvents.c | 42 | ||||
-rw-r--r-- | xorg-server/xkb/xkbInit.c | 4 |
7 files changed, 258 insertions, 190 deletions
diff --git a/xorg-server/xkb/XKBMisc.c b/xorg-server/xkb/XKBMisc.c index 6abd1d11a..6280637d6 100644 --- a/xorg-server/xkb/XKBMisc.c +++ b/xorg-server/xkb/XKBMisc.c @@ -330,7 +330,7 @@ _XkbFindMatchingInterp(XkbDescPtr xkb, static void _XkbAddKeyChange(KeyCode *pFirst, unsigned char *pNum, KeyCode newKey) { - KeyCode last; + int last; last = (*pFirst) + (*pNum); if (newKey < *pFirst) { diff --git a/xorg-server/xkb/ddxPrivate.c b/xorg-server/xkb/ddxPrivate.c index fcde3a18c..c4d21cb9c 100644 --- a/xorg-server/xkb/ddxPrivate.c +++ b/xorg-server/xkb/ddxPrivate.c @@ -3,12 +3,44 @@ #include <dix-config.h> #endif +#ifdef HAVE_XORG_CONFIG_H +#include <xorg-config.h> +#endif + +#include <stdio.h> #include <X11/X.h> #include "windowstr.h" +#define XKBSRV_NEED_FILE_FUNCS #include <xkbsrv.h> +#include "dixgrabs.h" +#include "os.h" +#include "xf86.h" + int XkbDDXPrivate(DeviceIntPtr dev, KeyCode key, XkbAction *act) { + XkbAnyAction *xf86act = &(act->any); + char msgbuf[XkbAnyActionDataSize+1]; + + if (xf86act->type == XkbSA_XFree86Private) { + memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize); + msgbuf[XkbAnyActionDataSize]= '\0'; + if (strcasecmp(msgbuf, "prgrbs")==0) { + DeviceIntPtr tmp; + ErrorF("Printing all currently active device grabs:\n"); + for (tmp = inputInfo.devices; tmp; tmp = tmp->next) + if (tmp->deviceGrab.grab) + PrintDeviceGrabInfo(tmp); + ErrorF("End list of active device grabs\n"); + } + else if (strcasecmp(msgbuf, "ungrab")==0) + UngrabAllDevices(FALSE); + else if (strcasecmp(msgbuf, "clsgrb")==0) + UngrabAllDevices(TRUE); + else if (strcasecmp(msgbuf, "prwins")==0) + PrintWindowTree(); + } + return 0; } diff --git a/xorg-server/xkb/makefile b/xorg-server/xkb/makefile new file mode 100644 index 000000000..e04599e52 --- /dev/null +++ b/xorg-server/xkb/makefile @@ -0,0 +1,42 @@ +DEFINES += HAVE_XKB_CONFIG_H + +DDX_SRCS = \ + ddxBeep.c \ + ddxCtrls.c \ + ddxLEDs.c \ + ddxLoad.c \ + ddxList.c + +DIX_SRCS = \ + xkb.c \ + xkbUtils.c \ + xkbEvents.c \ + xkbAccessX.c \ + xkbSwap.c \ + xkbLEDs.c \ + xkbInit.c \ + xkbActions.c \ + xkbPrKeyEv.c + +# this should be replaced by a common library or something, ideally -d +XKBFILE_SRCS = \ + maprules.c \ + xkmread.c \ + xkbtext.c \ + xkbfmisc.c \ + xkbout.c + +X11_SRCS = \ + XKBMisc.c \ + XKBAlloc.c \ + XKBGAlloc.c \ + XKBMAlloc.c + +# ends up unused... +# XI_SRCS = xkbPrOtherEv.c + +CSRCS = $(DDX_SRCS) $(DIX_SRCS) $(XI_SRCS) $(XKBFILE_SRCS) \ + $(X11_SRCS) ddxVT.c ddxPrivate.c ddxKillSrv.c + +LIBRARY=libxkb + diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c index efb178c7c..11660bf47 100644 --- a/xorg-server/xkb/xkb.c +++ b/xorg-server/xkb/xkb.c @@ -182,14 +182,13 @@ ProcXkbUseExtension(ClientPtr client) stuff->wantedMinor, SERVER_XKB_MAJOR_VERSION, SERVER_XKB_MINOR_VERSION); } - rep = (xkbUseExtensionReply) { - .type = X_Reply, - .supported = supported, - .sequenceNumber = client->sequence, - .length = 0, - .serverMajor = SERVER_XKB_MAJOR_VERSION, - .serverMinor = SERVER_XKB_MINOR_VERSION - }; + memset(&rep, 0, sizeof(xkbUseExtensionReply)); + rep.type = X_Reply; + rep.supported = supported; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.serverMajor = SERVER_XKB_MAJOR_VERSION; + rep.serverMinor = SERVER_XKB_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.serverMajor); @@ -579,22 +578,21 @@ ProcXkbGetState(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = &dev->key->xkbInfo->state; - rep = (xkbGetStateReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = 0, - .mods = XkbStateFieldFromRec(xkb) & 0xff, - .baseMods = xkb->base_mods, - .latchedMods = xkb->latched_mods, - .lockedMods = xkb->locked_mods, - .group = xkb->group, - .lockedGroup = xkb->locked_group, - .baseGroup = xkb->base_group, - .latchedGroup = xkb->latched_group, - .compatState = xkb->compat_state, - .ptrBtnState = xkb->ptr_buttons - }; + memset(&rep, 0, sizeof(xkbGetStateReply)); + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.mods = XkbStateFieldFromRec(xkb) & 0xff; + rep.baseMods = xkb->base_mods; + rep.latchedMods = xkb->latched_mods; + rep.lockedMods = xkb->locked_mods; + rep.group = xkb->group; + rep.lockedGroup = xkb->locked_group; + rep.baseGroup = xkb->base_group; + rep.latchedGroup = xkb->latched_group; + rep.compatState = xkb->compat_state; + rep.ptrBtnState = xkb->ptr_buttons; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.ptrBtnState); @@ -691,38 +689,38 @@ ProcXkbGetControls(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = dev->key->xkbInfo->desc->ctrls; - rep = (xkbGetControlsReply) { - .type = X_Reply, - .deviceID = ((DeviceIntPtr) dev)->id, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(SIZEOF(xkbGetControlsReply) - - SIZEOF(xGenericReply)), - .mkDfltBtn = xkb->mk_dflt_btn, - .numGroups = xkb->num_groups, - .groupsWrap = xkb->groups_wrap, - .internalMods = xkb->internal.mask, - .ignoreLockMods = xkb->ignore_lock.mask, - .internalRealMods = xkb->internal.real_mods, - .ignoreLockRealMods = xkb->ignore_lock.real_mods, - .internalVMods = xkb->internal.vmods, - .ignoreLockVMods = xkb->ignore_lock.vmods, - .repeatDelay = xkb->repeat_delay, - .repeatInterval = xkb->repeat_interval, - .slowKeysDelay = xkb->slow_keys_delay, - .debounceDelay = xkb->debounce_delay, - .mkDelay = xkb->mk_delay, - .mkInterval = xkb->mk_interval, - .mkTimeToMax = xkb->mk_time_to_max, - .mkMaxSpeed = xkb->mk_max_speed, - .mkCurve = xkb->mk_curve, - .axOptions = xkb->ax_options, - .axTimeout = xkb->ax_timeout, - .axtOptsMask = xkb->axt_opts_mask, - .axtOptsValues = xkb->axt_opts_values, - .axtCtrlsMask = xkb->axt_ctrls_mask, - .axtCtrlsValues = xkb->axt_ctrls_values, - .enabledCtrls = xkb->enabled_ctrls, - }; + + rep.type = X_Reply; + rep.deviceID = ((DeviceIntPtr) dev)->id; + rep.sequenceNumber = client->sequence; + rep.length = bytes_to_int32(SIZEOF(xkbGetControlsReply) - + SIZEOF(xGenericReply)); + rep.mkDfltBtn = xkb->mk_dflt_btn; + rep.numGroups = xkb->num_groups; + rep.groupsWrap = xkb->groups_wrap; + rep.internalMods = xkb->internal.mask; + rep.ignoreLockMods = xkb->ignore_lock.mask; + rep.internalRealMods = xkb->internal.real_mods; + rep.ignoreLockRealMods = xkb->ignore_lock.real_mods; + rep.internalVMods = xkb->internal.vmods; + rep.ignoreLockVMods = xkb->ignore_lock.vmods; + rep.repeatDelay = xkb->repeat_delay; + rep.repeatInterval = xkb->repeat_interval; + rep.slowKeysDelay = xkb->slow_keys_delay; + rep.debounceDelay = xkb->debounce_delay; + rep.mkDelay = xkb->mk_delay; + rep.mkInterval = xkb->mk_interval; + rep.mkTimeToMax = xkb->mk_time_to_max; + rep.mkMaxSpeed = xkb->mk_max_speed; + rep.mkCurve = xkb->mk_curve; + rep.axOptions = xkb->ax_options; + rep.axTimeout = xkb->ax_timeout; + rep.axtOptsMask = xkb->axt_opts_mask; + rep.axtOptsValues = xkb->axt_opts_values; + rep.axtCtrlsMask = xkb->axt_ctrls_mask; + rep.axtCtrlsValues = xkb->axt_ctrls_values; + rep.enabledCtrls = xkb->enabled_ctrls; + memcpy(rep.perKeyRepeat, xkb->per_key_repeat, XkbPerKeyBitArraySize); if (client->swapped) { swaps(&rep.sequenceNumber); @@ -1464,16 +1462,14 @@ ProcXkbGetMap(ClientPtr client) CHK_MASK_LEGAL(0x03, stuff->partial, XkbAllMapComponentsMask); xkb = dev->key->xkbInfo->desc; - rep = (xkbGetMapReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2, - .present = stuff->partial | stuff->full, - .minKeyCode = xkb->min_key_code, - .maxKeyCode = xkb->max_key_code - }; - + memset(&rep, 0, sizeof(xkbGetMapReply)); + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2; + rep.present = stuff->partial | stuff->full; + rep.minKeyCode = xkb->min_key_code; + rep.maxKeyCode = xkb->max_key_code; if (stuff->full & XkbKeyTypesMask) { rep.firstType = 0; rep.nTypes = xkb->map->num_types; @@ -2778,14 +2774,14 @@ ProcXkbGetCompatMap(ClientPtr client) xkb = dev->key->xkbInfo->desc; compat = xkb->compat; - rep = (xkbGetCompatMapReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .deviceID = dev->id, - .firstSI = stuff->firstSI, - .nSI = stuff->nSI - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.deviceID = dev->id; + rep.firstSI = stuff->firstSI; + rep.nSI = stuff->nSI; + if (stuff->getAllSI) { rep.firstSI = 0; rep.nSI = compat->num_si; @@ -3042,13 +3038,12 @@ ProcXkbGetIndicatorState(ClientPtr client) if (!sli) return BadAlloc; - rep = (xkbGetIndicatorStateReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = 0, - .state = sli->effectiveState - }; + + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.state = sli->effectiveState; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -3155,13 +3150,13 @@ ProcXkbGetIndicatorMap(ClientPtr client) xkb = dev->key->xkbInfo->desc; leds = xkb->indicators; - rep = (xkbGetIndicatorMapReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = 0, - .which = stuff->which - }; + + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.which = stuff->which; + XkbComputeGetIndicatorMapReplySize(leds, &rep); return XkbSendIndicatorMap(client, leds, &rep); } @@ -3312,13 +3307,13 @@ ProcXkbGetNamedIndicator(ClientPtr client) } } - rep = (xkbGetNamedIndicatorReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .deviceID = dev->id, - .indicator = stuff->indicator - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.deviceID = dev->id; + rep.indicator = stuff->indicator; + if (map != NULL) { rep.found = TRUE; rep.on = ((sli->effectiveState & (1 << i)) != 0); @@ -3894,18 +3889,18 @@ ProcXkbGetNames(ClientPtr client) CHK_MASK_LEGAL(0x01, stuff->which, XkbAllNamesMask); xkb = dev->key->xkbInfo->desc; - rep = (xkbGetNamesReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = 0, - .which = stuff->which, - .nTypes = xkb->map->num_types, - .firstKey = xkb->min_key_code, - .nKeys = XkbNumKeys(xkb), - .nKeyAliases = xkb->names ? xkb->names->num_key_aliases : 0, - .nRadioGroups = xkb->names ? xkb->names->num_rg : 0 - }; + memset(&rep, 0, sizeof(xkbGetNamesReply)); + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.which = stuff->which; + rep.nTypes = xkb->map->num_types; + rep.firstKey = xkb->min_key_code; + rep.nKeys = XkbNumKeys(xkb); + rep.nKeyAliases = xkb->names ? xkb->names->num_key_aliases : 0; + rep.nRadioGroups = xkb->names ? xkb->names->num_rg : 0; + XkbComputeGetNamesReplySize(xkb, &rep); return XkbSendNames(client, xkb, &rep); } @@ -4943,12 +4938,12 @@ ProcXkbGetGeometry(ClientPtr client) CHK_ATOM_OR_NONE(stuff->name); geom = XkbLookupNamedGeometry(dev, stuff->name, &shouldFree); - rep = (xkbGetGeometryReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = 0 - }; + + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + status = XkbComputeGetGeometryReplySize(geom, &rep, stuff->name); if (status != Success) return status; @@ -5531,15 +5526,15 @@ ProcXkbPerClientFlags(ClientPtr client) } } - rep = (xkbPerClientFlagsReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .supported = XkbPCF_AllFlagsMask, - .value = client->xkbClientFlags & XkbPCF_AllFlagsMask, - .autoCtrls = interest ? interest->autoCtrls : 0, - .autoCtrlValues = interest ? interest->autoCtrlValues : 0, - }; + memset(&rep, 0, sizeof(xkbPerClientFlagsReply)); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.supported = XkbPCF_AllFlagsMask; + rep.value = client->xkbClientFlags & XkbPCF_AllFlagsMask; + rep.autoCtrls = interest ? interest->autoCtrls : 0; + rep.autoCtrlValues = interest ? interest->autoCtrlValues : 0; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.supported); @@ -5651,19 +5646,18 @@ ProcXkbListComponents(ClientPtr client) list.pool = NULL; return status; } - rep = (xkbListComponentsReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = XkbPaddedSize(list.nPool) / 4, - .nKeymaps = 0, - .nKeycodes = list.nFound[_XkbListKeycodes], - .nTypes = list.nFound[_XkbListTypes], - .nCompatMaps = list.nFound[_XkbListCompat], - .nSymbols = list.nFound[_XkbListSymbols], - .nGeometries = list.nFound[_XkbListGeometry], - .extra = 0 - }; + memset(&rep, 0, sizeof(xkbListComponentsReply)); + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = XkbPaddedSize(list.nPool) / 4; + rep.nKeymaps = 0; + rep.nKeycodes = list.nFound[_XkbListKeycodes]; + rep.nTypes = list.nFound[_XkbListTypes]; + rep.nCompatMaps = list.nFound[_XkbListCompat]; + rep.nSymbols = list.nFound[_XkbListSymbols]; + rep.nGeometries = list.nFound[_XkbListGeometry]; + rep.extra = 0; if (list.nTotal > list.maxRtrn) rep.extra = (list.nTotal - list.maxRtrn); if (client->swapped) { @@ -5718,6 +5712,8 @@ ProcXkbGetKbdByName(ClientPtr client) if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; + memset(&mrep,0,sizeof(mrep)); //MH + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); master = GetMaster(dev, MASTER_KEYBOARD); @@ -6264,25 +6260,24 @@ ProcXkbGetDeviceInfo(ClientPtr client) wanted &= ~XkbXI_IndicatorsMask; nameLen = XkbSizeCountedString(dev->name); - rep = (xkbGetDeviceInfoReply) { - .type = X_Reply, - .deviceID = dev->id, - .sequenceNumber = client->sequence, - .length = nameLen / 4, - .present = wanted, - .supported = XkbXI_AllDeviceFeaturesMask, - .unsupported = 0, - .nDeviceLedFBs = 0, - .firstBtnWanted = 0, - .nBtnsWanted = 0, - .firstBtnRtrn = 0, - .nBtnsRtrn = 0, - .totalBtns = dev->button ? dev->button->numButtons : 0, - .hasOwnState = (dev->key && dev->key->xkbInfo), - .dfltKbdFB = dev->kbdfeed ? dev->kbdfeed->ctrl.id : XkbXINone, - .dfltLedFB = dev->leds ? dev->leds->ctrl.id : XkbXINone, - .devType = dev->xinput_type - }; + memset((char *) &rep, 0, SIZEOF(xkbGetDeviceInfoReply)); + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = nameLen / 4; + rep.present = wanted; + rep.supported = XkbXI_AllDeviceFeaturesMask; + rep.unsupported = 0; + rep.nDeviceLedFBs = 0; + rep.firstBtnWanted = 0; + rep.nBtnsWanted = 0; + rep.firstBtnRtrn = 0; + rep.nBtnsRtrn = 0; + rep.totalBtns = dev->button ? dev->button->numButtons : 0; + rep.hasOwnState = (dev->key && dev->key->xkbInfo); + rep.dfltKbdFB = dev->kbdfeed ? dev->kbdfeed->ctrl.id : XkbXINone; + rep.dfltLedFB = dev->leds ? dev->leds->ctrl.id : XkbXINone; + rep.devType = dev->xinput_type; ledClass = stuff->ledClass; ledID = stuff->ledID; @@ -6748,15 +6743,15 @@ ProcXkbSetDebuggingFlags(ClientPtr client) xkbDebugFlags = newFlags; xkbDebugCtrls = newCtrls; - rep = (xkbSetDebuggingFlagsReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .currentFlags = newFlags, - .currentCtrls = newCtrls, - .supportedFlags = ~0, - .supportedCtrls = ~0 - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.currentFlags = newFlags; + rep.currentCtrls = newCtrls; + rep.supportedFlags = ~0; + rep.supportedCtrls = ~0; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.currentFlags); diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c index 1adb38921..c1edeea55 100644 --- a/xorg-server/xkb/xkbActions.c +++ b/xorg-server/xkb/xkbActions.c @@ -1425,6 +1425,7 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y) { ValuatorMask mask; int gpe_flags = 0; + int Point[]={x, y}; /* ignore attached SDs */ if (!IsMaster(dev) && !IsFloating(dev)) @@ -1435,8 +1436,8 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y) else gpe_flags = POINTER_RELATIVE; - valuator_mask_set_range(&mask, 0, 2, (int[]) { - x, y}); + valuator_mask_set_range(&mask, 0, 2, + Point); InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, &mask); } diff --git a/xorg-server/xkb/xkbEvents.c b/xorg-server/xkb/xkbEvents.c index 87a4485eb..66a6e1509 100644 --- a/xorg-server/xkb/xkbEvents.c +++ b/xorg-server/xkb/xkbEvents.c @@ -99,7 +99,8 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, continue; if (keymap_changed) { - xEvent core_mn = { .u.u.type = MappingNotify }; + xEvent core_mn; + core_mn.u.u.type = MappingNotify; core_mn.u.mappingNotify.request = MappingKeyboard; /* Clip the keycode range to what the client knows about, so it @@ -117,11 +118,10 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, WriteEventsToClient(clients[i], 1, &core_mn); } if (modmap_changed) { - xEvent core_mn = { - .u.mappingNotify.request = MappingModifier, - .u.mappingNotify.firstKeyCode = 0, - .u.mappingNotify.count = 0 - }; + xEvent core_mn; + core_mn.u.mappingNotify.request = MappingModifier; + core_mn.u.mappingNotify.firstKeyCode = 0; + core_mn.u.mappingNotify.count = 0; core_mn.u.u.type = MappingNotify; WriteEventsToClient(clients[i], 1, &core_mn); } @@ -131,26 +131,24 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, * here? Clients might be upset, but that seems better than the * alternative of stale keymaps. -ds */ if (keymap_changed) { - deviceMappingNotify xi_mn = { - .type = DeviceMappingNotify, - .deviceid = kbd->id, - .request = MappingKeyboard, - .firstKeyCode = first_key, - .count = num_keys, - .time = time - }; + deviceMappingNotify xi_mn; + xi_mn.type = DeviceMappingNotify; + xi_mn.deviceid = kbd->id; + xi_mn.request = MappingKeyboard; + xi_mn.firstKeyCode = first_key; + xi_mn.count = num_keys; + xi_mn.time = time; SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } if (modmap_changed) { - deviceMappingNotify xi_mn = { - .type = DeviceMappingNotify, - .deviceid = kbd->id, - .request = MappingModifier, - .firstKeyCode = 0, - .count = 0, - .time = time - }; + deviceMappingNotify xi_mn; + xi_mn.type = DeviceMappingNotify; + xi_mn.deviceid = kbd->id; + xi_mn.request = MappingModifier; + xi_mn.firstKeyCode = 0; + xi_mn.count = 0; + xi_mn.time = time; SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } diff --git a/xorg-server/xkb/xkbInit.c b/xorg-server/xkb/xkbInit.c index 4e8e267da..861c2815d 100644 --- a/xorg-server/xkb/xkbInit.c +++ b/xorg-server/xkb/xkbInit.c @@ -670,7 +670,7 @@ extern int XkbDfltRepeatInterval; extern unsigned short XkbDfltAccessXTimeout; extern unsigned int XkbDfltAccessXTimeoutMask; extern unsigned int XkbDfltAccessXFeedback; -extern unsigned char XkbDfltAccessXOptions; +extern unsigned short XkbDfltAccessXOptions; int XkbProcessArguments(int argc, char *argv[], int i) @@ -731,7 +731,7 @@ XkbProcessArguments(int argc, char *argv[], int i) j++; } if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) { - XkbDfltAccessXOptions = (unsigned char) + XkbDfltAccessXOptions=(unsigned short) strtol(argv[++i], NULL, 16); j++; } |