summaryrefslogtreecommitdiff
path: root/xkb
AgeCommit message (Collapse)AuthorFilesLines
2010-05-19Set event sequence number in WriteEventsToClient instead of at callers.Jamey Sharp1-1/+0
TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-25/+25
Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13Do not jump through the hoops to deallocate xkbbasedirflag variableMikhail Gusarov1-5/+3
Fixes gcc warning as well. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov14-351/+351
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-27xkb: Fix omissions in geometry initialization #27679Dirk Wallenstein1-2/+39
_XkbCopyGeom did not copy all of the data from the source geometry. This resulted in failures when trying to obtain the keymap from a server where the default geometry has not been replaced by a custom configuration. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-21xkb: check for NULL pointer before dereferences it in XkbWriteXKBSymbolsTiago Vignatti1-2/+7
move srv assignment to before it's being used. Also, check for xkb being nil. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-21xkb: check for NULL pointer before dereferences it in XkbAddClientResourceTiago Vignatti1-2/+1
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19xkb: rename XkbFakeDeviceButton and XkbFakeDeviceMotion, move into xkbActions.cPeter Hutterer4-149/+85
The name XkbDDXFakeDeviceButton and XkbDDXFakeDeviceMotion is somewhat misleading, there's no DDX involved in the game at all anymore. This removes XkbFakeDeviceMotion and XkbFakeDeviceButton from the API where it arguably shouldn't have been in the first place. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19xkb: purge unneeded includes from ddxDevBtn.cPeter Hutterer1-9/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-16xkb: use GPE for XKB fake motion events.Peter Hutterer2-79/+25
Section 4.6.1 of the XKB spec says that "the initial event always moves the cursor the distance specified in the action [...]", so skip the POINTER_ACCELERATE flag for GPE, it would cause double-acceleration. Potential regression - GPE expects the coordinates to be either relative or both. XKB in theory allows for x to be relative and y to be absolute (or vice versa). Let's pretend that scenario has no users. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-04-16xkb: Guard against SIGIO updates during PointerKeys.Peter Hutterer1-1/+2
In theory, an event coming in during GPE could reset our lastSlave, leading to rather interesting events lateron. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-04-16xkb: Post PointerKeys through the XTEST device.Peter Hutterer1-2/+2
Posting an event through a master device may cause pointer jumps once lastSlave == master, caused by double scaling. To avoid this, post the fake event generated by XKB through the XTEST device instead. Fedora bug #560356 <https://bugzilla.redhat.com/560356> Tested-by: Andrew McNabb Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-03-24XKB: Fix garbage initializationJeremy Huddleston1-1/+1
XkbEnableDisableControls set extra garbage bits on the xkbControlsNotify changedControls mask because it was uninitialized on the stack. Found by clang Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-02xkb: sed True -> TRUE and False -> FALSEPeter Hutterer18-312/+312
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-02-02xkb: Add XKM file format description.Peter Hutterer1-0/+684
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-02-02xkb: make ctrl+alt+keypad + / ctrl+alt+keypad - work again (#25743)Horst Wente1-0/+6
Video mode switching via keypad keys did not work Signed-off-by: Horst Wente <horst.wente@acm.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-01-25xkb: remove XkbAtomGetString, replace with NameForAtom.Peter Hutterer3-8/+8
XKB really XKBdoes not XKBneed its own XKBdefines for XKBeverything. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25xkb: remove IsKeypadKey define, only used in two places.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25xkb: remove XConvertCase.Peter Hutterer1-2/+2
Since it's typedef'd to XkbConvertCase anyway and the headers are now split from the client headers, simply get rid of it altogether. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25xkb: remove _XkbClearElems, a memset will do.Peter Hutterer1-6/+7
Bonus point - it's easier to understand what's actually being done with the memory. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25xkb: remove _XkbTyped*allocPeter Hutterer10-80/+80
Please no extension-specific macros for memory allocation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith1-3/+1
Convert all calls of CreateNewResourceType to pass name argument Breaks DIX ABI. ABI versions bumped: Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18Ensure all resource types created have names registeredAlan Coopersmith1-0/+2
Calls RegisterResourceName to record the type name for use by X-Resource, XACE/SELinux/XTsol, and DTrace. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18Check for failures from CreateNewResourceTypeAlan Coopersmith1-1/+4
Make sure to check return value before setting bitmask flags. For most calls, just fails to init the extension. Since Xinput already calls FatalError() on initialization failure, so does failure to allocate Xinput's resource type. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-11xkb: don't assign garbage value to led_return.Peter Hutterer1-2/+3
As the comment for the function states, led_return is undefined if map is NULL. We might as well skip writing to it then. Found by clang. Reported-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2009-12-11Fix possible NULL dereference in XkbFlushLedEvents()Tomas Carnecky1-5/+7
Through some code paths it is possible that NULL is being passed in the 'ed' parameter to XkbFlushLedEvents(). Make sure we don't pass it along to bzero(). Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-11XkbWriteCountedString(): return early if str is NULLTomas Carnecky1-2/+5
This avoids NULL from being passed to memcpy() later in the code. While that wasn't an issue before - that value being NULL implied 'size == 0' so memcpy() wouldn't try to dereference it - it made the code harder to read and also confused clang. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-03Set the source and deviceid for key repeat events (#24785)Peter Hutterer1-0/+2
X.Org Bug 24785 <http://bugs.freedesktop.org/show_bug.cgi?id=24785> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Adam Jackson <ajax@redhat.com>
2009-10-20xkb: don't conditionally include xkb-config.h.Peter Hutterer3-6/+1
If HAVE_XKB_CONFIG_H is ever undefined, we fail to build anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-14xace: Relax permissions on XkbGetState from Read to Getattr.Eamon Walsh1-1/+1
This request is used to get the current keyboard group and is called from GTK. It does not return an actual keymap (aside from modifiers) so it should be safe to relax the permission on it. However it does return button state information which should be controlled through a separate pointer Read check. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-01xkb: check permissions on XKM_OUTPUT_DIRNirbheek Chauhan1-3/+2
Checking just for root is insufficient since that does not guarantee write/read permissions in XKM_OUTPUT_DIR (for example with sandbox). Check if we can write a file, as well as read it later. Otherwise, invoke the fallback to /tmp Signed-off-by: Nirbheek Chauhan <nirbheek@gentoo.org> Signed-off-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-30xkb: Use XkbPerKeyBitArraySize instead of hardcoded value of 32Jeremy Huddleston1-2/+2
2009-09-22input: don't use typecasts to access members of InternalEvent.Peter Hutterer2-2/+2
To avoid confusion, the member names are now postfixed with _event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-21input: define server-supported protocol versions in one single file.Peter Hutterer1-5/+6
include/protocol-versions.h specifies each extension version as supported by the server and sent back on the wire to the client. This fixes up several issues with the server potentially reporting a higher version of the protocol if recompiled against a newer version of the protocol. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Rémi Cardona <remi@gentoo.org> Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-14xkb: drop key presses for already repeating keys. (#23889)Peter Hutterer1-4/+8
The event sequence for continuously pressed keys with the keyboard driver is PRESS - PRESS - PRESS - ... - RELEASE. The first press sets the repeatKey to the keycode and the matching timer. The second press (on the same keycode) can be silently dropped instead of overwriting the timer again. X.Org Bug 23889 <http://bugs.freedesktop.org/show_bug.cgi?id=23889> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-09-13xkb: split effectiveGroup calculation into separate utility function.Peter Hutterer2-24/+40
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>