Commit Graph

239 Commits

Author SHA1 Message Date
Peter Hutterer
30c3c13f10 xkb: squash canonical types into explicit ones on core reconstruction.
If we update key types from core, and groups 2 - n have a canonical type but
the same symbols as the explicit type of group 1, assume that it was a core
sym duplication according to Section 12.4 of the XKB Protocol Spec.
Ignore the canonical types and pretend there's only one group for the key -
with the explicit key type.

The protocol spec does not cover this case, so we have to guess here.
2008-09-26 09:33:39 +09:30
Peter Hutterer
ae986d1c73 xkb: fix core keyboard map generation. #14373
According to Section 12.4 of the XKB Protocol Spec, if a key only has a single
group but the keyboard has multiple groups defined, the core description of
the key is a duplication of the single group across all symbols. i.e.
G1L1 G1L2 G1L1 G1L2 G1L3 G1L4 G1L3 G1L4

The previous code generated G1L1 G1L2 G1L3 G1L4 G1L3 G1L4, leading to
"invented" groups when the process is reversed.

Note that this creates wrong key types on reconstruction from core to xkb,
i.e. any single-group key with a key type that is not one of the canonical
four (Sec 12.2.3), will get the assigned type on group 1, and a canonical type
for the other gruops.

X.Org Bug 14373 <http://bugs.freedesktop.org/show_bug.cgi?id=14373>
2008-09-26 09:33:39 +09:30
Kim Woelders
8c46505d7d xkb: fix use of uninitialized variable.
And some cosmetic changes to use stuff->change consistently.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-09-22 08:37:29 +09:30
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Matthieu Herrb
2e2ce817ce Move strcasecmp(), strcasencmp() and strcasestr() prototypes to os.h
And make sure os.h is included in files that use it.
2008-08-10 23:07:46 +02:00
Peter Hutterer
d684f5760f xkb: actually initialise sli before using it. 2008-08-08 16:19:20 +09:30
Peter Hutterer
c06e27b2f6 xkb: ProcXkbSetDeviceInfo should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
d9ca9819e9 xkb: ProcXkbSetGeometry should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
5ba87c3327 xkb: ProcXkbSetNames should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
7e45c80204 xkb: ProcXkbSetNamedIndicator should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
a609dbed7c xkb: ProcXkbSetIndicatorMap should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
e8c2a3d7c9 xkb: ProcXkbSetCompatMap should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
3c7740aa8f xkb: ProcXkbSetMap should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
31afd51dd4 xkb: ProcXkbBell should work on all attached SDs.
If called with XkbUseCoreKbd, run through all attached SDs and replicate the
call. This way, we keep the SDs in sync with the MD as long as core clients
control the MDs.
2008-08-06 11:12:24 +09:30
Peter Hutterer
6c1bb64c6f xkb: break up XkbCopyKeymap into bite-sized chunks. 2008-08-04 15:42:39 +09:30
Peter Hutterer
54651ff5ec xkb: remove superfluous inputInfo.keyboard treatment.
Really not necessary, we can just walk the list and spare us the special
treatment of the VCK.
2008-07-28 09:05:53 +09:30
Peter Hutterer
70bd826122 xkb: use PickPointer/PickKeyboard in _XkbLookupAnyDevice. 2008-07-28 09:05:12 +09:30
Peter Hutterer
ad4cd2e241 xkb: don't send core events on SlowKeys.
Core events don't happen until later in the DIX, so pump device events down
instead. This makes modifiers work again when SlowKeys is enabled.
2008-07-28 09:04:48 +09:30
Adam Jackson
9757106bba Remove all empty extension reset hooks, replace with NULL. 2008-07-24 15:46:08 -04:00
Adam Jackson
5035741fd4 Unifdef __osf__ 2008-07-23 13:38:38 -04:00
Adam Jackson
bd8bd2c700 Unifdef AIX. 2008-07-23 13:37:42 -04:00
Adam Jackson
856db05b58 Unifdef sgi. 2008-07-23 13:37:42 -04:00
Adam Jackson
0ff5bc4048 Unifdef QNX.
Again, hasn't worked since at least 7.0.
2008-07-23 10:44:34 -04:00
Daniel Stone
446fe9eecd Dead code removal
Remove a whole bunch of code that was never built, be it entire files or
just dead ifdefs.
2008-07-17 21:37:50 +03:00
Mathieu Bérard
47833eef35 Drop a bunch of #ifdef Lynx. 2008-07-17 11:59:24 -04:00
Alan Coopersmith
7ce6dcef11 Don't log null device name in XkbDDXLoadKeymapByNames 2008-06-25 15:06:49 -07:00
Peter Hutterer
bcc88a1d46 xkb: remove unused variable is_core. 2008-06-25 09:59:46 +09:30
Peter Hutterer
d21155a3e9 input: fix up usage of button->down, used to be a bitmask, is now an array.
device->button->down used to be a 32-byte bitmask with one bit for each
button. This has changed into a 256-byte array, with one byte assigned for
each button. Some of the callers were still using this array as a bitmask
however, this is fixed with this patch.

Thanks to Keith Packard for pointing this out. See also:
http://lists.freedesktop.org/archives/xorg/2008-June/036202.html
2008-06-18 10:17:08 +09:30
Eamon Walsh
5544c51447 Fix "warning: the address of ‘newTypes’ will always evaluate as ‘true’". 2008-06-13 22:49:47 -04:00
Eamon Walsh
2391c409a2 Fix "warning: unused variable `s'". 2008-06-13 22:48:17 -04:00
Peter Hutterer
ff3adf3e56 xkb: reset xkb_cached_map on CloseDownDevices.
Could lead to some invalid pointers in the second server generation.
2008-06-05 08:53:34 +09:30
Peter Hutterer
5a3d06b8f4 xkb: delete default rules when devices are closed.
We only have one set of default rules options in xkb. When the second keyboard
is brought up with Xkb options specified, these new options overwrite the old.
In future server generations, the rules used for the VCK are a mixture of the
default ones and ones previously specified for other keyboards. Simply
resetting the xkb default rules to NULL avoids this issue.

Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the
second server generation, the VCK has "us(nodeadkeys)". This again produces a
SIGABRT when the first key is hit.

I could not figure out why the SIGABRT happens. This patch is avoiding the
issue rather than fixing it.
2008-06-02 10:27:05 +09:30
Peter Hutterer
30e9a33f7d xkb: fix crash caused by uninitialised variable. 2008-05-22 16:00:21 +09:30
Peter Hutterer
4056595fc7 xkb: remove superfluous checks in if statement. 2008-05-20 18:57:54 +09:30
Peter Hutterer
99d28c3ef3 Merge branch 'master' into mpx
Conflicts:

	Xext/xprint.c (removed in master)
	config/hal.c
	dix/main.c
	hw/kdrive/ati/ati_cursor.c (removed in master)
	hw/kdrive/i810/i810_cursor.c (removed in master)
	hw/xprint/ddxInit.c (removed in master)
	xkb/ddxLoad.c
2008-05-20 10:20:14 +09:30
Alan Coopersmith
7cdc19b29d When XKB fails to open rules file, log the file name, not the NULL file pointer 2008-05-13 16:39:30 -07:00
Daniel Stone
cf20df39cc XKB: Actually explain keymap failures
When something went wrong building a keymap, try to explain to the user
what it actually was, instead of the dreaded 'Failed to load XKB keymap'
catch-all.
2008-05-07 22:56:03 +03:00
Peter Hutterer
8190ef8754 Merge branch 'master' into mpx
Conflicts:

	Xext/EVI.c
	Xext/appgroup.c
	Xext/cup.c
	Xext/mitmisc.c
	Xext/sampleEVI.c
	dix/window.c
2008-04-22 18:04:05 +09:30
Egbert Eich
449723510a xkb: use the correct device instead of an uninitialised "dev". #15614
X.Org Bug 15614 <http://bugs.freedesktop.org/show_bug.cgi?id=15614>

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-04-22 13:30:25 +09:30
Peter Hutterer
eebdf69e9a xkb: mixing up src and dst in a memcpy is suboptimal. 2008-04-18 14:39:28 +09:30
Peter Hutterer
3106ba1116 xkb: two fixes to avoid server crashes.
- map can be NULL in some cases, so don't try to dereference it.
- don't default to inputInfo.keyboard

This is firefighting, I presume something in the class copy may have gone
wrong to get a NULL map in the first instance?
2008-04-13 11:48:06 +09:30
Peter Hutterer
4219e94c2f xkb: Add XkbCopySrvLedInfo, deep-copies a XkbSrvLedInfoRec. 2008-04-13 08:27:31 +09:30
Peter Hutterer
6271df6953 xkb: don't overwrite CtrlProc in the second run of XkbFinishDeviceInit.
XkbFinishDeviceInit is called once when the device is initialised, but also
when a class copy causes the key class of a device to change. In this case, overwriting the CtrlProc of the KeybdFeedbackClass with XkbDDXKeybdCtrlProc sets up a nice recursive loop of XkbDDXKeybdCtrlProc calling itself until the cows come home.
2008-04-08 08:42:58 +09:30
Peter Hutterer
fd06e8f8c1 Merge branch 'master' into dcdc_rework
Conflicts:

	Xext/xevie.c
	dix/dispatch.c
2008-04-07 07:56:41 +09:30
Thomas Jaeger
37b1258f0a XKB: Fix processInputProc wrapping
If input processing is frozen, only wrap realInputProc: don't smash
processInputProc as well.  When input processing is thawed, pIP will be
rewrapped correctly.

This supersedes the previous workaround in 50e80c9.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2008-04-01 15:31:50 +03:00
Daniel Stone
090b26db76 XkbCopyKeymap: Fix broken indentation
An astute observer will note that the entirety of XkbCopyKeymap is indented
with spaces, and no tabs whatsoever, and not commit changes which break the
otherwise consistent indentation.
A non-astute observer will note the breakage when the commit mail comes
through with clearly broken indentation.
A polite, non-astute, observer will then fix it.

C'est la vie.
2008-03-14 21:58:27 +02:00
Keith Packard
b2657ec598 XkbCopyKeymap was mangling doodads and overlays 2008-03-10 21:29:12 -07:00
Adam Jackson
34b69e3bc0 Fix distcheck.
(cherry picked from commit 2a47accff8)
2008-03-05 23:57:15 -05:00
Peter Hutterer
4f2cd0ed96 Merge branch 'master' into mpx
This merge reverts Magnus' device coorindate scaling changes. MPX core event
generation is very different, so we can't scale in GetPointerEvents.

Conflicts:

	Xi/opendev.c
	dix/devices.c
	dix/dixfonts.c
	dix/getevents.c
	dix/resource.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	mi/mipointer.c
	xkb/ddxBeep.c
	xkb/ddxCtrls.c
	xkb/ddxKeyClick.c
	xkb/ddxList.c
	xkb/ddxLoad.c
	xkb/xkb.c
	xkb/xkbAccessX.c
	xkb/xkbEvents.c
	xkb/xkbInit.c
	xkb/xkbPrKeyEv.c
	xkb/xkbUtils.c
2008-03-04 18:11:10 +10:30
Daniel Stone
0bd0f90d7c XKB: Fix initial map setting on startup
Due to an unwitting sense inversion when eliminating XkbFileInfo, we were
setting the complete wrong keymap on startup (non-XKB map if we had an XKB
map available, or the XKB map if we didn't have any available).  Invert the
sense properly, and add two small bits that also went missing in that commit.
2008-03-04 03:50:25 +02:00