Commit Graph

14 Commits

Author SHA1 Message Date
Peter Hutterer
0e4dd3b2d2 Un-export ApplyPointerMapping. This is an in-server function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03 08:39:26 +10:00
Alan Coopersmith
95b678e6dc Correct modifier map built when ProcSetModifierMapping is called
Fixes xmodmap changes to modifiers to stop corrupting modifier maps

Previous code had two bugs:
 - the code to increment mod was after the code to continue if no
   modifier was set, so mod wouldn't be incremented for modifiers
   with no keys mapped to them (such as if you called
   xmodmap -e 'clear Lock')
 - the value it set in the modifier map was the raw modifier number,
   not the bitmask value for that modifier

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-05 11:15:54 +10:00
Peter Hutterer
34424fab9a dix: set the client's error value to the bad deviceid in check_butmap_change.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-01 08:46:30 +10:00
Ben Gamari
07154db4a8 Xi: Remove redundant and incorrect butmap range check
Maps are CARD8s, therefore checking for values above 255 is completely
unnecessary. Moreover, 0 is a valid value for maps, so the check wasn't
even correct to begin with. This fixes bug #22392, which was uncovered
by commit 280b7f92d7.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-23 11:53:33 +10:00
Peter Hutterer
b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
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-22 15:44:50 +10:00
Peter Hutterer
42719ce5c7 dix: remove superfluous loop in change_modmap.
A device can only be attached to a single master device. So instead of
looping and searching for the master device, we can just use dev->u.master
directly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-20 16:22:24 +10:00
Peter Hutterer
e3c1096273 dix: build_modmap_from_modkeymap needs to bounds-check its argument.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-03-27 11:26:15 +10:00
Peter Hutterer
cffa3c499a dix: remove unused variable 'tmp'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:50:55 +10:00
Peter Hutterer
a50c40be1f dix: don't apply button mappings to SDs, or the device's MD. (#20122)
Only ever change the button map on the device we actually care about, not the
attached SDs, not the current MD of the device.

X.Org Bug 20122 <http://bugs.freedesktop.org/show_bug.cgi?id=20122>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-02-23 18:54:53 +10:00
Daniel Stone
4fa3872dc2 Input: Remove core keysyms from KeyClassRec
Instead of always keeping two copies of the keymap, only generate the
core keymap from the XKB keymap when we really need to, and use the XKB
keymap as the canonical keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:59 +11:00
Daniel Stone
bc909f7136 Input: Centralise pointer map changing
Replace both core and Xi functions with one function that validates the
proposed map, and sends out both kinds of notification.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:58 +11:00
Daniel Stone
f06a9d2e05 Input: Clean up keymap change notifications
Keyboard map notifications are always generated from within XKB code,
which also takes care of copying the keysyms, etc.  If you need to
mangle the keymap yourself, generate a new core keymap/modmap, and pass
it to XkbApplyMappingChange.

SendMappingNotify is renamed to SendPointerMappingNotify (and ditto its
Device variants), which still only _sends_ the notifications, as opposed
to also doing the copying a la XkbApplyMappingChange.

Also have the modmap change code traverse the device hierachy, rather
than just going off the core keyboard.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-22 15:08:58 +11:00
Daniel Stone
32db27a7f8 Input: Remove modifierMap from core
We already have modmap (in the exact same format!) in XKB, so just use
that all the time, instead of duplicating the information.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
f062e90a95 Input: Remove modifierKeyMap
Since modifierKeyMap is generated from modifierMap, just remove it, and
only generate it when we need to send the modifier map to the client.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00