Commit Graph

90 Commits

Author SHA1 Message Date
Peter Hutterer
007e93c869 xkb: Switch the xkb event processing path over to InternalEvents.
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-23 17:52:39 +10:00
Alan Coopersmith
5623c27700 Constify atom name strings
Changes MakeAtom to take a const char * and NameForAtom to return them,
since many callers pass pointers to constant strings stored in read-only
ELF sections.   Updates in-tree callers as necessary to clear const
mismatch warnings introduced by this change.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 10:06:00 -08:00
Daniel Stone
7c4c00649c XKB: Remove unused DDX functions
They were complete no-ops anyway.

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
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
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
1ad80678d8 XKB: Remove support for setting combined keymaps
We don't do full keymaps anymore.  Deal.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:56 +11:00
Daniel Stone
08363c5830 Input: Overhaul keyboard initialisation process
XkbInitKeyboardDeviceStruct is now the only valid keyboard
initialisation: all the details are hidden behind here.  This now makes
it impossible to supply a core keymap at startup.

If dev->key is valid, dev->key->xkbInfo->desc is also valid.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:51 +11:00
Daniel Stone
40877c6680 XKB: Make XKB mandatory
No more #ifdef XKB, because you can't disable the build, and no more
noXkbExtension either.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:06:25 +11:00
Daniel Stone
5c281446d2 XKB: Remove lock actions disabling
For some reason, XKB allows clients to set a global (!) flag that simply
turns lock keys into state no-ops.  Ignore this flag.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-22 14:23:24 +11:00
Daniel Stone
07c3bb922b XKB: Move XkbCopyKeymap definition to xkbsrv.h
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-20 15:32:18 +11:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Paulo Cesar Pereira de Andrade
fb22d4d928 Remove declarations of symbols that are never defined.
These symbols were removed from the X Server, or never declared.
  One symbol that may need special attention is XkbBuildCoreState(),
that doesn't have a prototype anywhere, but is called from
xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros
XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in
include/xkbstr.h.
  fb/wfbrename.h also may need some cleanup, as it makes several
"renames" of non existing symbols.
2008-11-30 01:33:20 -02:00
Daniel Stone
caf1e6a1c9 XKB: Move XKBrules.h to the server too
Get our own local copy of this, so we don't have to define XKB_IN_SERVER
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:01:07 +10: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
4219e94c2f xkb: Add XkbCopySrvLedInfo, deep-copies a XkbSrvLedInfoRec. 2008-04-13 08:27:31 +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
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
fbd7768946 XKB: Ditch XkbFileInfo
Sorry about the megacommit, but this touches on a lot of stuff.

Get rid of XkbFileInfo, which was pretty seriously redundant, and move the
only useful thing it had (defined) into XkbDescRec.  defined will be removed
pretty soon anyway.  Is the compat map pointer non-NULL? Then you have a
compat map, congratulations! Anyhow, I digress.

All functions that took an XkbFileInfoPtr now take an XkbDescPtr, _except_
XkmReadFile, which returns an XkbDescPtr *, because people want to deal in
XkbDescPtrs, not XkbDescRecs.
2008-02-17 22:52:08 +02:00
Daniel Stone
ab79110a84 XKB: Remove support for pre-built keymaps
Don't load prebuilt keymaps anymore.
2008-02-17 22:52:07 +02:00
Daniel Stone
1332343910 XKB: Remove usage of client-side types
Since we're no longer sharing with Xlib, don't pass Displays and XPointers
everywhere.
2008-02-17 22:52:07 +02:00
Daniel Stone
0f12a448dc XKB: Deprecate XKBSRV_NEED_FILE_FUNCS
There's no point in having the function definitions be conditional, so
whatever.
2008-02-17 22:52:07 +02:00
Daniel Stone
68bd7ac193 XKB: Move headers into the server tree
We need to start breaking the XKB API to enforce sanity, so drag whichever
headers we need to do so into the server tree, as the client API is set in
stone, being part of Xlib.
2008-02-17 22:52:07 +02:00
Daniel Stone
e4eb7e5842 XKB: Delete xkberrs.c
Get rid of the XKB errors code to save a bunch of space.
2008-02-17 22:52:06 +02:00
Peter Hutterer
8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Peter Hutterer
50e80c3987 include: never overwrite realInputProc with enqueueInputProc. Bug #13511
In some cases (triggered by a key repeat during a sync grab) XKB unwrapping
can overwrite the device's realInputProc with the enqueueInputProc. When the
grab is released and the events are replayed, we end up in an infinite loop.
Each event is replayed and in replaying pushed to the end of the queue again.

This fix is a hack only. It ensures that the realInputProc is never
overwritten with the enqueueInputProc.

This fixes Bug #13511 (https://bugs.freedesktop.org/show_bug.cgi?id=13511)
(cherry picked from commit eace88989c)
2007-12-19 19:10:08 +10:30
Peter Hutterer
eace88989c include: never overwrite realInputProc with enqueueInputProc. Bug #13511
In some cases (triggered by a key repeat during a sync grab) XKB unwrapping
can overwrite the device's realInputProc with the enqueueInputProc. When the
grab is released and the events are replayed, we end up in an infinite loop.
Each event is replayed and in replaying pushed to the end of the queue again.

This fix is a hack only. It ensures that the realInputProc is never
overwritten with the enqueueInputProc.

This fixes Bug #13511 (https://bugs.freedesktop.org/show_bug.cgi?id=13511)
2007-12-19 16:20:36 +10:30
Peter Hutterer
0b729051c0 Merge branch 'master' into mpx
Conflicts:

	Xi/extinit.c
	Xi/grabdev.c
	Xi/setmode.c
	Xi/ungrdev.c
	dix/devices.c
	dix/events.c
	dix/getevents.c
	include/dix.h
	mi/midispcur.c
	mi/misprite.c
	xkb/xkbActions.c
	xkb/xkbEvents.c
	xkb/xkbPrKeyEv.c
2007-11-07 15:37:23 +10:30
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Peter Hutterer
99e826e867 xkb: enable XI event processing for xkb.
XI events can now take the same processing paths as core events, and should do
the correct state changes etc.

There's some cases where XKB will use KeyPress as type for an event to be
delivered to the client. Stuck warnings in, not sure what the correct solution
is yet.

(cherry picked from commit 6334d4e7be with some
 additional compile fixes and non-MPX adaptations)
2007-10-28 16:04:43 +02:00
Peter Hutterer
91077bfc50 Save processInputProc before wrapping it and restore it later, instead of
using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to
process DeviceKeyEvents after the first key press.

This should be the correct fix now.
(cherry picked from commit 4d5df14f2c)
2007-10-28 15:51:34 +02:00
Peter Hutterer
8b9481a113 xkb: Store the action filters per device in the XkbSrvInfoRec.
Using a global array for action filters is bad. If two keyboard hit a modifier
at the same time, releaseing the first one will deactivate the filter and
thus the second keyboard can never release the modifier again.
(cherry picked from commit bfe6b4d2d9)
2007-10-28 15:51:10 +02:00
Daniel Stone
a3d48de5f2 XKB: Add more bits to xkbsrv.h
Add the device private index, given we use that in a macro here, and also the
prototype for xkbUnwrapProc, since that's also useful.
2007-10-28 15:50:03 +02:00
Eamon Walsh
8b54865720 xace: add hooks + new access codes: XKB extension.
Removes "LookupKeyboardDevice" and "LookupPointerDevice" in favor of
inputInfo.keyboard and inputInfo.pointer, respectively; all use cases
are non-XI compliant anyway.
2007-09-28 13:34:18 -04:00
Peter Hutterer
c4db4d1fcf include: remove register keywords. 2007-09-24 12:37:59 +09:30
Peter Hutterer
6334d4e7be xkb: enable XI event processing for xkb.
XI events can now take the same processing paths as core events, and should do
the correct state changes etc.

There's some cases where XKB will use KeyPress as type for an event to be
delivered to the client. Stuck warnings in, not sure what the correct solution
is yet.
2007-09-06 18:49:57 +09:30
Peter Hutterer
bfe6b4d2d9 xkb: Store the action filters per device in the XkbSrvInfoRec.
Using a global array for action filters is bad. If two keyboard hit a modifier
at the same time, releaseing the first one will deactivate the filter and
thus the second keyboard can never release the modifier again.
2007-09-05 15:09:29 +09:30
Eamon Walsh
4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Peter Hutterer
4d5df14f2c Save processInputProc before wrapping it and restore it later, instead of
using a hardcoded ProcessKeyboardEvent. Otherwise we lose the ability to
process DeviceKeyEvents after the first key press.

This should be the correct fix now.
2007-06-21 18:24:30 +09:30
Adam Jackson
021fc5cb2c Static markup and dead code cull over xkb/.
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as
include/xkbsrv.h, and the world updated to look for it in the new place,
since it made no sense to define server API in an extension header.  Any
further work along this line will need to do similar things with XKBgeom.h
and friends.
2007-03-20 18:37:02 -04:00