Peter Hutterer [Fri, 17 Feb 2012 03:23:08 +0000 (13:23 +1000)]
Don't leak output_info
This inverts the logic to have a more obvious flow for freeing the
output_info.
==26716== 1,161 bytes in 8 blocks are definitely lost in loss record 5 of 7
==26716== at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==26716== by 0x395D804ABA: XRRGetOutputInfo (in /usr/lib64/libXrandr.so.2.2.0)
==26716== by 0x40932B: map_output_xrandr (transform.c:150)
==26716== by 0x40982F: map_to_output (transform.c:263)
==26716== by 0x4070A4: main (xinput.c:386)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Alan Coopersmith [Thu, 22 Dec 2011 05:31:51 +0000 (21:31 -0800)]
print_version expects no arguments, so give it none
Fixes Solaris Studio compiler warning:
"xinput.c", line 357: warning: argument mismatch: 1 arg passed, 0 expected
gcc ignored it because the function declaration didn't specify arguments.
Once you specify (void) for the arguments, gcc then throws up:
xinput.c: In function ‘main’:
xinput.c:357:9: error: too many arguments to function ‘print_version’
xinput.c:147:1: note: declared here
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Bryce Harrington [Wed, 30 Nov 2011 01:33:23 +0000 (17:33 -0800)]
xinput: Assume 'list' by default if no args given.
xrandr lists all outputs by default when run with no args. So, make
xinput list all inputs by default when run the same way, so the tools
are consistent.
Signed-off-by: Bryce Harrington <bryce@canonical.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 19 Aug 2011 03:07:57 +0000 (13:07 +1000)]
Support the new Scroll class
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Peter Hutterer [Fri, 12 Aug 2011 04:20:21 +0000 (14:20 +1000)]
list: don't use defines for checking server version.
Otherwise we run into the old problem again: recompiling xinput against
newer inputproto headers will appear to change the version support,
potentially causing errors or other misbehaviours.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Peter Hutterer [Thu, 2 Jun 2011 00:20:42 +0000 (10:20 +1000)]
Add support for device-to-screen mapping
xinput map-to-crtc "device name" "VGA0" will map to the CRTC "VGA0" by
manipulating the transformation matrix accordingly. And because the NVIDIA
binary driver still exists, Xinerama is supported to. Maybe in another 5
years, they'll catch up.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
Peter Hutterer [Tue, 5 Jul 2011 22:38:50 +0000 (08:38 +1000)]
man: Move my name to the top of the authors list
It's reasonably likely that someone looking at the list of authors will
email the first one on the list. Let that be the current maintainer, it's
more likely that there will be the desired response.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org>
Peter Hutterer [Thu, 2 Jun 2011 01:43:13 +0000 (11:43 +1000)]
Remove superfluous comment.
We can't remove this part if we want to keep working against 1.7 and 1.8.1.
No big deal, if this operation in xinput is the performance-critical path of
a system, things have gone bad a long time ago.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Julien Cristau <jcristau@debian.org>
Peter Hutterer [Wed, 1 Jun 2011 23:14:40 +0000 (09:14 +1000)]
Announce support for XI 2.0 to the server.
Technically, we're required to announce support for XI 2.0 through
XIQueryVersion. The behaviour of XI2 for clients that have not done so is
undefined, it just happens to work.
With XI 2.1 on the horizon, this may change so make sure we're clamining our
version correctly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
Peter Hutterer [Tue, 3 May 2011 07:02:48 +0000 (17:02 +1000)]
Silence compiler warning
Static analysis claims that ptr += size may assign garbage. But since the
protocol requires format to be 8, 16 or 32, size should always have a valid
value. Initialize to 0 to shut up clang.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Peter Hutterer [Tue, 18 Jan 2011 02:55:46 +0000 (12:55 +1000)]
Add --name-only flag for 'xinput list'.
The default output of xinput list is hard to parse by scripts. Provide a
--name-only option to print the device name only, without any other
information.
Gaetan Nadon [Wed, 12 Jan 2011 18:10:21 +0000 (13:10 -0500)]
config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls
AC_PROG_C_C99. This sets gcc with -std=gnu99.
If AC_PROG_CC macro is called afterwards, it resets CC to gcc.
Gaetan Nadon [Wed, 12 Jan 2011 15:21:24 +0000 (10:21 -0500)]
config: update AC_PREREQ statement to 2.60
Unrelated to the previous patches, the new value simply reflects
the reality that the minimum level for autoconf to configure
all x.org modules in one pass is 2.60 dated June 2006.
A version later than 2.60 can be used, but no new features from such
a later version can be used in configure.ac.
Although the code in this module can be configured with a version earlier
than 2.60, most of code is now contained in macros from util-macros
which use features of version 2.60, at the present or in the future.
Peter Hutterer [Wed, 22 Dec 2010 02:57:00 +0000 (12:57 +1000)]
Remove unneeded include.
This include was added during the MPX/XI2 development cycle, likely when the
headers weren't in an acceptable state and clients needed stuff defined in
the proto headers. Normal clients shouldn't need the proto headers though
and xinput builds fine without it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Chase Douglas [Wed, 17 Nov 2010 15:42:38 +0000 (10:42 -0500)]
Zero out entire mask when selecting for different events
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Chase Douglas [Thu, 1 Jul 2010 22:36:42 +0000 (18:36 -0400)]
xinput: Split XI2 valuators and print index of events
XI2 events support bitmask selected valuators. When printing masked
events, we need to also print the index of the valuator value. This
change prints each valuator on its own line, prefixed by its index
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 9 Jun 2010 05:52:31 +0000 (15:52 +1000)]
list: only check the last bit in the device mode.
This works around a bug in X servers 1.7.x, 1.8.0 and 1.8.1 where the device
mode could sometimes be binary OR'd with the OutOfProximity flag. The result
was a value of 0b10 for relative and 0b11 for Absolute, both of which were
interpreted as relative by this code.
Affected is only the XIQueryDevice call, not the XListInputDevices call.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A 32bit value must be dereferenced to correctly zero-extend an Atom
from XIGetProperty. On 64bit systems, Atom is 64bits, so the final
Atom in a list will read garbage in the upper half of the Atom.
Will Thompson [Thu, 1 Apr 2010 14:35:34 +0000 (15:35 +0100)]
Warn and fail if a device name is ambiguous.
The XI1 path bails out if the user specifies a device by name and there
is more than one device, but the XI2 path previously just silently chose
the first one. This patch makes it fail outright.
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Gaetan Nadon [Wed, 28 Oct 2009 18:09:08 +0000 (14:09 -0400)]
INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
Add missing INSTALL file. Use standard GNU file on building tarball
README may have been updated
Remove AUTHORS file as it is empty and no content available yet.
Remove NEWS file as it is empty and no content available yet.
Gaetan Nadon [Tue, 27 Oct 2009 19:07:25 +0000 (15:07 -0400)]
Deploy the new XORG_DEFAULT_OPTIONS #24242
This macro aggregate a number of existing macros that sets commmon
X.Org components configuration options. It shields the configuration file from
future changes.
Gaetan Nadon [Thu, 22 Oct 2009 16:34:15 +0000 (12:34 -0400)]
.gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
> On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
> > I noticed an INSTALL file in xlsclients and libXvMC today, and it
> > was quite annoying to work around since 'autoreconf -fvi' replaces
> > it and git wants to commit it. Should these files even be in git?
> > Can I nuke them for the betterment of humanity and since they get
> > created by autoreconf anyways?
>
> See https://bugs.freedesktop.org/show_bug.cgi?id=24206
As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
of the INSTALL file. It is also part of the 24206 solution.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
Peter Hutterer [Fri, 9 Oct 2009 05:28:34 +0000 (15:28 +1000)]
Clean up --version, don't require a DISPLAY and display the server version too.
version.c was removed, seemed a bit excessive for the 20 lines of code.
--version is integrated separate from the other commands now, checked before
opening the display. xinput now prints its own version in all cases, even if
the display is unavailable. If the display is available, it prints the
server version too. Example output:
$> xinput --version
xinput version 1.4.99.3
XI version on server: 2.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 9 Oct 2009 05:07:30 +0000 (15:07 +1000)]
man: clean up the man page.
Several changes to the man page to tidy it up a bit:
- RCS tag removed
- synopsis shortened, OPTIONS section added instead
- "xinput" dropped before the option descriptions, options in manpage
prefixed with '--'.
- device_name replaced with just device, since it may be a deviceid.
- Removed references to XI man page calls that some options use, it really
doesn't matter to users what the underlying Xlib call is.
- mark set-int-prop and set-float-prop as deprecated in the man page.
- add --test_xi2 flag
- Added a few more authors.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
Thomas Jaeger [Wed, 7 Oct 2009 17:05:15 +0000 (13:05 -0400)]
Rework 'xinput list' code
* Drop the questionable --loop option
* Add a --long option (opposite of --short)
* Make --short the default if no device argument is given
* XI2: Make it possible to query a single device
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
squashed in a man page update for --short and --long.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2009 00:30:45 +0000 (10:30 +1000)]
test_xi2: don't map the window before selecting for events.
Mapping the window before selecting for XI2 events leaves some events out
(e.g. enter events if the pointer is already in the area where the window is
being mapped).
Reported-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>