summaryrefslogtreecommitdiff
path: root/hw/kdrive/src/kinput.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-22kdrive: Fix -Wshadow errorsKeith Packard1-2/+2
Just rename stuff to avoid conflicts. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12Replace 'pointer' type with 'void *'Keith Packard1-3/+3
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-14kdrive: fix cursor jumps on CursorOffScreen behaviorPeter Hutterer1-4/+4
This patch fixes cursor jumps when there is a grab on the Xephyr window and the pointer moves outside the window. So on two side-by-side 640x480 screens, a coordinate of 0/481 triggers KdCursorOffscreen. If the delta between two screens is 0, they share the same offset for that dimension. When searching for the new screen, the loop always rules out the current screen. So we get to the second screen, trigger the conditions where dy <= 0 and decide that this new screen is the correct one. The result is that whenever KdCursorOffScreen is called, the pointer jumps to the other screen. Change to check for dy < 0 etc. so that the cursor stays on the same screen if there is no other screen at the target location. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-11-14kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to thatPeter Hutterer1-0/+2
A multi-head Xephyr instance has the pointer stuck on one screen because of bad coordinate calculation. The coordinates passed to GetPointerEvents are per-screen, so the cursor gets stuck on the left-most screen by default. Adjust and mark the events as POINTER_DESKTOP, so the DIX can adjust them accordingly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-21unbreak KdEnableInputStrake1-5/+6
pi = ki = 0 here, so not follow them. Signed-off-by: Strake <strake888@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-06kdrive: fix build error on gcc 4.8 for out-of-bounds array accessChris Clayton1-1/+1
I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot of gcc-4.8: input.c:225:43: error: array subscript is above array bounds [-Werror=array-bounds] This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can be beyond the end of the array. Signed-off-by: Chris Clayton <chris2553@googlemail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-21kdrive: Fix const cast warnings in arguments processing.Eric Anholt1-2/+2
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21kdrive: Drop dead code.Eric Anholt1-7/+0
This is unused as of the introduction of a helper in e7150db5350bc2113ff4126019b489847a4dc217 Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-03-06kdrive: fix "set but not used" warningsPeter Hutterer1-8/+0
kinput.c: In function 'KdEnqueueKeyboardEvent': kinput.c:1845:16: warning: variable 'ctrl' set but not used kinput.c:1844:17: warning: variable 'keyc' set but not used kinput.c: In function 'KdEnqueuePointerEvent': kinput.c:1887:12: warning: variable 'ms' set but not used kxv.c: In function 'KdXVDisable': kxv.c:1181:19: warning: variable 'ScreenPriv' set but not used mouse.c: In function 'ps2SkipInit': mouse.c:444:9: warning: variable 'skipping' set but not used mouse.c: In function 'ps2Init': mouse.c:473:10: warning: variable 'waiting' set but not used mouse.c:472:9: warning: variable 'skipping' set but not used fbdev.c: In function 'fbdevRandRSetConfig': fbdev.c:468:19: warning: variable 'newheight' set but not used fbdev.c:468:9: warning: variable 'newwidth' set but not used Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Robert Morell <rmorell@nvidia.com>
2012-10-07Revert "kinput: allocate enough space for null character."Julien Cristau1-1/+1
This reverts commit 531785dd746d64ef7f473a83ca73bb20e74b6fca. The above commit breaks Xephyr option parsing. Andrzej writes: Xephyr -retro -keybd evdev,,device=/dev/input/event2,xkbrules=evdev,xkbmodel=evdev,xkblayout=pl -mouse evdev,,device=/dev/input/event1 :3 results in: <snip> Pointer option key (device=) of value (/dev/input/event1) not assigned! Kbd option key (device=) of value (/dev/input/event2) not assigned! Kbd option key (xkbrules=) of value (evdev) not assigned! Kbd option key (xkbmodel=) of value (evdev) not assigned! Kbd option key (xkblayout=) of value (pl) not assigned! <snip> The effect of the patch is that the "key=value" pairs are parsed in such a way that the key is added an "equals" sign to it and we end up with keys like "device=" instead of "device". This in turn has effect on KdParsePointerOptions and KdParseKbdOptions: the key does not match any choice presented in the "switch" statement, and so "Pointer/Kbd option key (...) of value (...) not assigned!" happens, making all "key=value" options inaccessible to the user. Reverting the patch makes them available again. Reference: http://bugs.debian.org/689246 Reported-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Cc: Dave Airlie <airlied@redhat.com> Reviewed-by: Søren Sandmann <ssp@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-06kinput: allocate enough space for null character.Dave Airlie1-1/+1
This code wasn't allocating enough space and was assigning the NULL one past the end. Pointed out by coverity. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-04Merge branch 'sigio-vt-switch-issues' into for-keithPeter Hutterer1-30/+10
Conflicts: test/Makefile.am Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-03Drop custom sigio block/unblock functions from kdrive, ephyr and dmxPeter Hutterer1-30/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-06-20kdrive: adjust BlockHandler/WakeupHandler to new APIPeter Hutterer1-3/+2
Missing API update caused Xephyr to crash on startup, garbage memory dereference when accessing timeout. Introduced in 1f0e8bd5eb1a5539689cfc4f5a6b86b530907ec5 kdrive.c:868:27: warning: assignment from incompatible pointer type kdrive.c:869:28: warning: assignment from incompatible pointer type Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-05api: rework the X server driver API to avoid global arrays.Dave Airlie1-2/+2
This is a squash merge containing all the API changes, as well as the video ABI bump. Its been squashed to make bisection easier. Full patch log below: commit b202738bbf0c5a1c1172767119c2c71f1e7f8070 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon May 14 15:16:11 2012 -0700 xfree86: Bump video ABI to 13.0 The ABI was broken by changes to convert from screen index numbers to ScreenPtr / ScrnInfoPtr in various structures and function signatures. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3 Author: Dave Airlie <airlied@redhat.com> Date: Thu May 24 10:56:57 2012 +0100 xf86: xf86ClearEntityListForScreen should take a pScrn When adding GPU screens this make life easier. (also fix comment, as pointed out by Alan) Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dave Airlie <airlied@redhat.com> commit afee8b5ab4501597ecc1ade34124d7ca227ab055 Author: Dave Airlie <airlied@redhat.com> Date: Thu May 24 07:07:32 2012 +0100 xf86i2c: add pscrn for drivers to use This just adds a pScrn pointer into the struct for the drivers to use instead of scrnIndex. Mostly scrnIndex is used for logging, but some drivers use it to lookup xf86Screens, so let them stash a pScrn instead. Removing the scrnIndex is a bit more involved and I'm not sure its worth the effort. Doing i2c in the X server is legacy code as far as I'm concerned. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit ea5092f1f679691d187f1eee9427e6057beec56e Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 19:25:20 2012 +0100 dix/gc: consolidate GC object creation in one place The standard GC create and scratch GC create were 90% the same really, and I have a need in the future for creating GC objects without the other bits, so wanted to avoid a third copy. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 10:24:06 2012 +0100 xf86: add a define to denote the new non-index interfaces are being used This can be used by drivers to provide compatible APIs. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 15:09:12 2012 +0100 dix: make Create/Free scratch pixmaps take a ScreenPtr While technically an API/ABI change I doubt anyone uses it, but it helps in splitting screens up. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:57:55 2012 +0100 xf86/xv: remove scrnIndexfrom xf86FindXvOptions. Move this interface to taking an ScrnInfoPtr. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:53:59 2012 +0100 xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2) stop passing indices into this function. v2: drop flags argument. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 58824e414f35682435f15bfe6c4b656bd90b9235 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:48:09 2012 +0100 xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:18:59 2012 +0100 xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2) Instead of passing an index, pass the actual ScreenPtr. This allows more moving towards not abusing xf86Screens + screenInfo. v2: drop the blockData/wakeupData args as per ajax's suggestion., fix docs. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 790d003de20fb47674420a24dadd92412d78620d Author: Dave Airlie <airlied@gmail.com> Date: Wed Apr 11 09:53:14 2012 +0100 xf86/common: remove some more pScrn->pScreen uses remove some more conversions that appeared after api cleanups. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:34:53 2012 +0100 ddc: change API to take ScrnInfoPtr (v2) This removes all xf86Screens usage from ddc code, it modifies the API for some functions to avoid taking indices. v2: address Alan's comments about dropping DDC2Init parameter. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit fe3f57b6eaf6860a33876a54f9439f69578f03a5 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:31:26 2012 +0100 vbe: don't use index for VBEInterpretPanelID (API) Remove use of xf86screens from vbe module. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit abf1965f4ed91529036d3fdb470d6a3ce6f29675 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:25:11 2012 +0100 int10/vbe: don't use xf86Screens. (ABI) (v3) Pass the ScrnInfoPtr instead of the index in the int10 struct. This saves us using it to dereference xf86Screens. v2: address Alan's comment to fix struct alignment. v3: squash in all the int10 fixes, test the vm86 code builds, after comments by Keith. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 23cca612b4fb5efc33683c7624b803b457387e3d Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:30:18 2012 +0100 xserver: drop index argument to ScreenInit (ABI/API) (v2) This drops the index argument, its the same as pScreen->myNum, and its the last major index abuse I can find. v2: address Alan's review - update docs, fix xwin/xnest/darwin Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:23:01 2012 +0100 xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API) This migrates PointerMoved from an index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:20:46 2012 +0100 xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API) This migrates the PMEvent from index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:18:30 2012 +0100 xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API) This migrates the SetDGAMode callback from an index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit baf5e4818a74f2b68c3dfdcc56f54322351039a0 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:14:11 2012 +0100 xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2) This migrates the ChangeGamma interface to avoid passing a index. v2: fix xf86RandR12.c + xf86cmap.c call Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 51e5f90ada929d6b23176090badbb42fdb3fa550 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:11:09 2012 +0100 xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API) The EXA interface migrates to ScreenPtr, and the xf86 interface migrated to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 94f1f21d17e86f96d4a54292a399160950087675 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:02:11 2012 +0100 xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API) This migrates the ValidMode to passing a ScrnInfoPtr instead of an index. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3f8f18198fed4f39ec805b508a3482e91eea26b2 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:59:46 2012 +0100 xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2) This migrate the SwitchMode interface to take a ScrnInfoPtr instead of an index. v2: drop flags. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit d06a038a5c49328ab3a8d969d24f9fcd22c63202 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:50:37 2012 +0100 xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2) This converts AdjustFrame code paths to passing a ScrnInfoPtr instead of an integer index. v2: drop flags args. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:41:27 2012 +0100 xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2) Another index->pScrn conversion. v2: drop flags arg. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:35:41 2012 +0100 xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2) This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr instead of an index into xf86Screens. This allows dropping more public dereferences of the xf86Screens and screenInfo. v2: drop flags args as suggested by Keith, fix docs. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 06729dbbc804a20242e6499f446acb5d94023c3c Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:04:59 2012 +0100 xserver: remove index from CloseScreen (API/ABI breakage) This drops the index from the CloseScreen callback, its always been useless really, since the pScreen contains it. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14kdrive: Remove redundant declarations.Michal Suchanek1-2/+0
Signed-off-by: Michal Suchanek <hramrach@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-22Change lastDeviceIdleTime to be per-devicePeter Hutterer1-1/+2
Preparation work for per-device idle counters. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-21Introduce a consistent coding styleKeith Packard1-697/+660
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-06kdrive: drop screen crossing code.Dave Airlie1-6/+0
The only kdrive server we probably care about anymore is Xephyr, and this screen enable/disable code totally breaks it in multi-screen mode. When you are in one screen the other stops updating. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457 Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23Convert some malloc + strncpy pairs into strndup callsAlan Coopersmith1-3/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25kdrive: check for null memory, fix OOBPeter Hutterer1-1/+7
If key/value allocation failed, don't bother adding another InputOption. And make sure the memory allocated is large enough for the trailing \0 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25input: switch InputOption to use XF86OptionRec storage.Peter Hutterer1-4/+5
Use the same struct for both InputOption and XF86OptionRec so we don't need to convert to and fro the two in the config backends. 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>
2011-10-25kdrive: switch to new InputOption API.Peter Hutterer1-60/+72
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2011-07-01input: free the EQ allocated memory on shutdown (#38634)Peter Hutterer1-0/+6
mieqFini() already does the right thing, but it needs to be called by the various DDXs and the XTest Extension. X.Org Bug 38634 <http://bugs.freedesktop.org/show_bug.cgi?id=38634> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Acked-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01KDrive: Remove useless miPointerUpdateSprite callDaniel Stone1-1/+0
miPointerUpdateSprite is already called from mieqProcessInputEvents, so calling it by hand immediately after isn't massively helpful. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30Fix UTF-8 encodingMatěj Cepl1-2/+2
Report to find out all non-UTF-8 files created by cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then /bin/true else echo $FILE fi done >>report Signed-off-by: Matěj Cepl <mcepl@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> [Daniel: git am failed for me, so I redid it. The method listed in the commit message also failed, so I just used file/grep/iconv. The results are the same though.] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-11input: remove DDX event list handlingPeter Hutterer1-8/+3
The current approach to event posting required the DDX to request the event list (allocated by the DIX) and then pass that list into QueuePointerEvent and friends. Remove this step and use the DIX event list directly. This means that QueuePointerEvent is not reentrant but it wasn't before anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11input: replace EventListPtr with InternalEvent arrayPeter Hutterer1-1/+1
EventListPtr is a relic from pre-1.6, when we had protocol events in the event queue and thus events of varying size. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11input: Provide Queue{Button|Keyboard|Proximity}Event helpersPeter Hutterer1-13/+5
Don't require every caller to use GPE + mieqEnqueue, provide matching Queue...Event functions instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18input: remove GetKeyboardValuatorEvents, this is now unnecessary.Peter Hutterer1-2/+2
GetKeyboardValuatorEvents handles NULL valuator masks already, so the GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-03-24xserver: remove AbsoluteClassRec keeping the ABISimon Thum1-1/+0
This removes the struct, but keeps InitAbsoluteClassDeviceStruct as a no-op and preserves related struct layout. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-24kdrive: don't pretent to support DEVICE_ABS_* in ChangeDeviceControlSimon Thum1-2/+0
Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-22Abstract valuator masks through a set of APIs.Peter Hutterer1-2/+5
This commit introduces an abstraction API for handling masked valuators. The intent is that drivers just allocate a mask, set the data and pass the mask to the server. The actual storage type of the mask is hidden from the drivers. The new calls for drivers are: valuator_mask_new() /* to allocate a valuator mask */ valuator_mask_zero() /* to reset a mask to zero */ valuator_mask_set() /* to set a valuator value */ The new interface to the server is xf86PostMotionEventM() xf86PostButtonEventM() xf86PostKeyboardEventM() xf86PostProximityEventM() all taking a mask instead of the valuator array. The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to memory allocation restrictions in SIGIO handlers. For easier review, a lot of the code still uses separate valuator arrays. This will be fixed in a later patch. This patch was initially written by Chase Douglas. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-09-01input: Purge AddOtherInputDevices DDX hook.Peter Hutterer1-7/+0
This hook wasn't used by any DDX. Device addition and removal is handled by the config backend, so we don't need to do anything special that during the ListInputDevices request processing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: remove OpenInputDevice and CloseInputDevice DDX hooks.Peter Hutterer1-17/+0
In theory, these hooks were to be used for DDX-specific device enablement. None of the DDXs however did anything here. Now we call DEVICE_INIT on all devices when they are added, so the xfree86 DDX as the only one with real code didn't do anything here. kdrive checked for device validity but that's already handled in ProcXOpenDevice. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01input: Purge Register*Device() functions.Peter Hutterer1-4/+0
RegisterPointerDevice() and RegisterKeyboardDevice() were already mapped to RegisterOtherDevice() and obsolete. RegisterOtherDevice() was called for all devices and the two assignments can simply be moved into AddInputDevice(). Purge RegisterOtherDevice() and pretend it never happened. *lalalalala* Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01xfree86: remove superflous assignments.Peter Hutterer1-4/+0
ActivateGrab and DeactivateGrab are set in AddInputDevice() already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-06-11kdrive: Get rid of xstrdup when argument is definitely non-NULLMikhail Gusarov1-6/+6
ditto for Kdrive Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-12/+12
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-01-01Remove trailing whitespaceMikhail Gusarov1-37/+37
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-30config: add libudev input-hotplug backendJulien Cristau1-0/+8
Add a backend using libudev for input hotplug, and disable the hal and dbus backends if this one is enabled. XKB configuration happens using xkb{rules,model,layout,variant,options} properties (case-insensitive) on the device. We fill in InputAttributes to allow configuration through InputClass in Xorg. Requires udev 148 for the input_id helper and ID_INPUT* properties. Signed-off-by: Julien Cristau <jcristau@debian.org> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-22config: Introduce InputAttributes in NewInputDeviceRequestDan Nicholson1-1/+2
In order to give NewInputDeviceRequest more information, a new InputAttributes type is introduced. Currently, this collects the product and vendor name, device path, and sets booleans for attributes such as having keys and/or a pointer. Only the HAL backend fills in the attributes, though. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
2009-10-20Use the default XKB settings for dmx and kdrive.Peter Hutterer1-5/+5
Drop the dmx-specific defines, there's no reason to have separate ones considering they're about as hardcoded as the default rules anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-09kdrive: output meaningful error message for HAL devices.Peter Hutterer1-0/+8
kdrive ignores all devices from hal as they don't have the 'type' option set. Instead of "Unrecognised device identifier!" print out "Ignoring device from HAL." to indicate that the errors surrounding the device don't really matter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-09-09kdrive: remove xkb member from KdKeyboardInfoPeter Hutterer1-1/+0
Wasn't being used by anyone. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30include: untangle events.h from the SDK headers.Peter Hutterer1-0/+1
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-06-18input: Add labels to buttons and valuators - ABI_XINPUT_VERSION 7Peter Hutterer1-2/+43
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-11KDrive: Warning fixesDaniel Stone1-12/+12
xEvent vs. InternalEvent confusion still reigns though. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-06-11KDrive: Warning fixes and cleanupsDaniel Stone1-46/+2
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-06-03kdrive: add protocol mouse optionOlivier Blin1-0/+3
kdrive probes a lot of PS/2 protocols for the mouse device, which makes the mouse unusable for some seconds after X startup. This new "protocol" option allows forcing the mouse protocol. It can be used this way: Xfbdev -mouse mouse,,protocol=ps/2 -keybd keyboard Signed-off-by: Olivier Blin <blino@mandriva.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>