summaryrefslogtreecommitdiff
path: root/xkb
AgeCommit message (Collapse)AuthorFilesLines
2009-09-04xkb: xkbGetKbdByName on the lastSlave needs to change the master (#21859)Peter Hutterer1-0/+10
If the layout is changed on a master's lastSlave, the master needs to change layout immediately. Otherwise, the master stays on the same layout until the lastSlave changes - which may not happen if only a single keyboard is available. X.Org Bug 21859 <http://bugs.freedesktop.org/show_bug.cgi?id=21859> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-04input: allow for detectable autorepeat.Daniel Stone3-171/+97
For core and XI1 events, store the key_repeat flag in the sequence number until TryClientEvents. The sequenceNumber is unset until TryClientEvents. [Also thrown in, some random indentation changes. Thanks] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-05xkb: remove now-unused XkbGetKeysym.Peter Hutterer1-29/+0
XkbGetKeysyms was only used by the now-removed Keysym grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30xkb: move XkbFilterEvents to xkbsrv.hPeter Hutterer1-2/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30xkb: restore XKB PtrBtn actions.Peter Hutterer1-81/+26
Ifdef'd out since the switch to internal events. PtrBtn actions now work again. Instead of generating the event directly, GPE generates the event and it is then posted through the usual event processing routines (mieqProcessDeviceEvent). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30include: untangle events.h from the SDK headers.Peter Hutterer4-0/+4
InternalEvents shouldn't be used anywhere outside the X server itself. Split up into events.h for opaque typedefs for the events needed by various headers and eventstr.h for the actual struct definitions. eventstr.h must only be included by code that requires internal events and is not part of the SDK. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-16xkb: cosmetic fix, use TRUE instead of True.Peter Hutterer1-1/+1
Rest of InitKeyboardDeviceStruct uses TRUE and FALSE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15xkb: Remove XKMformat.h include from xkbsrv.h into the files that need it.Peter Hutterer5-0/+5
xkbsrv.h is used by drivers, they don't need the XKM format and shouldn't require it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14xkb: switch to byte counting functionsPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-10Revert "XKB: Sanitise * actions" commits (#19602)Peter Hutterer5-34/+38
Reverts the following four patches: feb757f384382c7782ceac55 "XKB: Sanitise vmods for redirected keys" b5f49382fe48f0a762d9a15f "XKB: Sanitise ctrls action" 1bd7fd195d85681e722161f8 "XKB: Sanitise pointer actions" 61c508fa78aa08ea2666fde9 "XKB: Sanitise vmods in actions" Strictly speaking, the structs used in the server are not part of the client ABI. Practically, they are as we copy from the wire straight into the structs. Changing the struct sizes breaks various wire/server conversions. Even when the structs have the same size, some internal magic causes conversions to fail. Visible by diffing the output files of: setxkbmap -layout de; xkbcomp -xkb :0 busted.xkb setxkbmap -layout de -print | xkbcomp -xkb - correct.xkb Interestingly enough, busted.xkb is the working one although the output is incorrect. Revert the four offending patches until the exact cause of this breakage can be determined. This patch restores functionality to Level3 modifiers. X.Org Bug 19602 <http://bugs.freedesktop.org/show_bug.cgi?id=19602> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-17Xi: Add support for sourceid in the device classes.Peter Hutterer1-0/+1
2009-06-02xkb: allow pointer events to pass through for floating SDs without a key class.Peter Hutterer1-5/+15
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-28Merge branch 'master' into xi2Peter Hutterer11-140/+138
Conflicts: Xext/geext.c Xi/chdevcur.c Xi/extgrbdev.c Xi/xiproperty.c configure.ac dix/ptrveloc.c hw/xfree86/common/xf86Config.c mi/mipointer.h test/input.c xkb/xkb.c
2009-05-22input: allow for master pointers to not have a button class.Peter Hutterer1-1/+1
There's devices (e.g. some barcode readers) that have axes but no buttons. When such a device sends a motion event, the valuator and button class is copied into the master pointer (i.e. removing the button class). So we need a couple of extra sanity checks for the button class to exist. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22Input: rename DeviceIntRec->isMaster to ->type.Peter Hutterer1-16/+16
isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev).
2009-05-22Bug #6428, #16458, #21464: Fix crash due to uninitialized VModMap fields.Tomas Janousek1-3/+5
In ProcXkbGetKbdByName, mrep.firstVModMapKey, .nVModMapKeys and .totalVModMapKeys were not initialized, contained random values and caused accesses to unallocated and later modified memory, causing XkbSizeVirtualModMap and XkbWriteVirtualModMap to see different number of nonzero values, resulting in writes past the end of an array in XkbSendMap. This patch initializes those values sensibly and reverts commits 5c0a2088 and 6dd4fc46, which have been plain non-sense. Signed-off-by: Tomas Janousek <tomi@nomi.cz> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-21input: rename device->type to device->xinput_type.Peter Hutterer1-1/+1
This type is only used in XI to give a hint of what type this device may be. Call it xinput_type for clarity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-21Bug #6428, #16458, #21464: Fix crash due to uninitialized VModMap fields.Tomas Janousek1-3/+5
In ProcXkbGetKbdByName, mrep.firstVModMapKey, .nVModMapKeys and .totalVModMapKeys were not initialized, contained random values and caused accesses to unallocated and later modified memory, causing XkbSizeVirtualModMap and XkbWriteVirtualModMap to see different number of nonzero values, resulting in writes past the end of an array in XkbSendMap. This patch initializes those values sensibly and reverts commits 5c0a2088 and 6dd4fc46, which have been plain non-sense. Signed-off-by: Tomas Janousek <tomi@nomi.cz> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16xkb: if kbd init failed, NULL out the pointers after freeing them (#21278)Peter Hutterer1-0/+3
Reproducible: Configure a server that uses the keyboard driver with an invalid ruleset, e.g. (Option "XkbRules" "foobar"). Ensure that Option "AllowEmptyInput" is "off" in the ServerFlags or ServerLayout section. Start the server. After failing to init the keymap, the server will try to clean up after the device, double-freeing some xkb structs that have not been reset properly. X.Org Bug 21278 <http://bugs.freedesktop.org/show_bug.cgi?id=21278> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-11xkb: if kbd init failed, NULL out the pointers after freeing them (#21278)Peter Hutterer1-0/+3
Reproducible: Configure a server that uses the keyboard driver with an invalid ruleset, e.g. (Option "XkbRules" "foobar"). Ensure that Option "AllowEmptyInput" is "off" in the ServerFlags or ServerLayout section. Start the server. After failing to init the keymap, the server will try to clean up after the device, double-freeing some xkb structs that have not been reset properly. X.Org Bug 21278 <http://bugs.freedesktop.org/show_bug.cgi?id=21278> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-09Revert "xkb: write the _XKB_RF_RULES_PROP to each device."Peter Hutterer1-58/+25
This commit shouldn't have been pushed, we're still sorting out the API we want to use. This reverts commit 876910a951053f0bd31e30098de3da15a1c1f5d6. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08xkb: remove _XkbAlloc, _XkbCalloc, _XkbRealloc and _XkbFreePeter Hutterer10-136/+136
We all agree that wrapping is fun, but seriously. One of these days someone will get hurt. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08xkb: remove some now-useless XFUNCPROTOBEGINPeter Hutterer1-4/+0
We bring them back if we start rewriting the server in C++, promise. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-06Xi: add GrabButton and GrabKeysym code.Peter Hutterer1-0/+30
We don't do keycode grabs in XI2, they're pointless.
2009-05-06xkb: remove oldState from XkbHandleActions.Peter Hutterer1-4/+2
I really don't know what the purpose of this variable is or was, aside from potentially clobbering up our key state since there's a path where it may be used uninitialised. Also, this means that xkbi->prev_state is now accessible from the DIX with meaningful data. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-03XkbSetNamedIndicator should ignore SD's without LED'sAlan Coopersmith1-0/+2
When ProcXkbSetNamedIndicator is called on a core device, and we walk the slaves to set the LED's on each of them, ignore any slaves that do not have either a KbdFeedbackCtrl or LedCtrl structure. (This is much more critical in xserver-1.5-branch, where we walk *all* devices, not just the slaves of the specified master, and thus return failure when setting an LED on the Core Keyboard and hit a xf86-input-mouse device with no LED's to set.) Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-01xkb: write the _XKB_RF_RULES_PROP to each device.Peter Hutterer1-25/+58
We only have one root window and writing the rules used to the same property for each device is quite pointless if you don't have the same RMLVO on all devices. So let's be sensible and write the same property to the device too, so at least we know which device got loaded with which RMLVO.
2009-04-24Merge branch 'master' into xi2Peter Hutterer1-0/+1
Conflicts: Xi/chdevhier.c include/input.h
2009-04-20xkb: set bell_func in InitKeyboardDeviceStruct.Colin Harrison1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19Merge branch 'master' into xi2Peter Hutterer1-1/+38
2009-04-19xkb: Add XkbFreeRMLVOSet helper function.Peter Hutterer1-11/+19
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com>
2009-04-17xkb: strdup the values returned by XkbGetRulesDfltsPeter Hutterer1-0/+21
XkbGetRulesDftls may get a copy of what will later be freed when passed into XkbSetRulesDftls. On the second run of XkbGet/SetRulesDflts: XkbGetRulesDflts(rmlvo) rmlvo->rules = current-rules XkbSetRulesDflts(rmlvo) free(current-rules) current-rules = strdup(rmlvo->rules) Leaving us with garbage in current-rules. This patch requires callers of XkbGetRulesDflts to free the associated memory. See also http://lists.freedesktop.org/archives/xorg-devel/2009-February/000305.html Reported-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-04-17input: allow NULL as XkbRMVLOSet in InitKeyboardDeviceStruct.Peter Hutterer1-1/+9
Virtually all callers use XkbGetRulesDefault(&rmlvo); InitKeyboardDeviceStruct(..., rmlvo); Let's save them the trouble and accept NULL as a hint to take the default RMLVO. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-04-07Merge branch 'master' into xi2Peter Hutterer2-2/+4
2009-03-23xkb: plug a memory leak in XkbCopySrvLedInfo (#20756)Maarten Maathuis1-1/+1
X.Org Bug 20756 <http://bugs.freedesktop.org/show_bug.cgi?id=20756> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-23xkb: put a few extra checks in against non-keyboardsPeter Hutterer1-1/+3
2009-03-20xkb: remove Device/Enter leave handling - XI2 enter/leave don't have compat ↵Peter Hutterer1-4/+0
state.
2009-03-20xkb: don't overrun the map index when accessing symbols.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-16xkb: xkbi has a pointer to the device - use this instead of inputInfo.pointer.Peter Hutterer1-1/+1
2009-03-16xkb: the VCP can post device events, don't stop xkb filtering on it.Peter Hutterer1-2/+2
2009-03-16xkb: Fix a mis-use of inputInfo.keyboard.Peter Hutterer1-5/+4
2009-03-16xkb: fix a couple of device checks when looping through all devices.Peter Hutterer1-9/+4
Generally, we want to apply stuff to the device and to all attached slave devices.
2009-03-03Fix build with --enable-debug.Jason Vas Dias1-1/+1
[amended by Peter Hutterer] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23Input: change processing API to InternalEvents.Peter Hutterer4-11/+14
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>
2009-02-23xkb: _XkbFilterRedirectKey needs to pass InternalEvents down.Peter Hutterer1-10/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23Xi: support InternalEvents in UpdateDeviceState, parts of POE and EnqueueEventPeter Hutterer3-28/+3
Note that this breaks DGA. Life is tough. EnqueueEvent is a somewhat half-baked solution, we immediately drop back into XI and store them. But it should in theory work. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Don't let the dcce be random data.
2009-02-23xkb: Switch the xkb event processing path over to InternalEvents.Peter Hutterer3-78/+106
Before dropping down into the DIX, convert back into XI events. This is a temporary solution only, until the DIX is capable of handling InternalEvents anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-20xkb: Use cached XKB keymap when rules haven't changedDan Nicholson1-2/+46
Rather than compiling a new keymap every time InitKeyboardDeviceStruct is called, cache the previous keymap and reuse it if the rules have not changed. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-17xkb: Fix wrong colour reference in XKB geometry copying. #20081Peter Hutterer1-2/+2
base_color and label_color need to reference the color in the destination, not in the source. X.Org Bug 20081 <http://bugs.freedesktop.org/show_bug.cgi?id=20081> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-02-16xserver: Avoid sending uninitialized padding data over the networkPeter Åstrand3-1/+11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>