Timo Aaltonen pushed to branch debian-unstable at X Strike Force / app / xinput
Commits:
-
29e7ec5a
by Peter Hutterer at 2016-10-24T08:58:22+10:00
-
5ecd774d
by Peter Hutterer at 2017-01-26T10:37:26+10:00
-
d63b2f2d
by Alan Coopersmith at 2017-01-26T10:37:59+10:00
-
fb9cb617
by Peter Hutterer at 2017-01-26T10:38:29+10:00
-
60d812e5
by Emil Velikov at 2017-01-26T10:38:29+10:00
-
ed8c0865
by Mihail Konev at 2017-01-26T14:00:21+10:00
-
98848812
by Peter Hutterer at 2018-01-22T10:24:49+10:00
-
3ea8f020
by Peter Hutterer at 2018-09-12T14:49:21+10:00
-
5a8f3121
by Peter Hutterer at 2018-09-13T09:39:22+10:00
-
c7ca2b99
by Alan Coopersmith at 2018-11-21T17:10:59-08:00
-
d0a77e79
by Peter Hutterer at 2019-03-27T09:31:35+10:00
-
cef07c0c
by Peter Hutterer at 2019-07-17T15:25:10+10:00
-
9580c535
by Timo Aaltonen at 2020-03-24T12:16:08+02:00
-
095d962e
by Timo Aaltonen at 2020-03-24T12:18:17+02:00
-
bbb423a1
by Timo Aaltonen at 2020-03-24T12:19:09+02:00
-
5e41d5f4
by Timo Aaltonen at 2020-03-24T12:23:07+02:00
-
0bc70e04
by Timo Aaltonen at 2020-03-24T12:24:18+02:00
-
2b0e6eac
by Timo Aaltonen at 2020-03-24T12:24:41+02:00
-
1b00f092
by Timo Aaltonen at 2020-03-24T12:25:44+02:00
-
61368913
by Timo Aaltonen at 2020-03-24T12:26:54+02:00
13 changed files:
- autogen.sh
- configure.ac
- debian/changelog
- − debian/compat
- debian/control
- debian/rules
- debian/watch
- man/xinput.man
- src/list.c
- src/property.c
- src/test_xi2.c
- src/xinput.c
- src/xinput.h
Changes:
1 | 1 |
#! /bin/sh
|
2 | 2 |
|
3 |
-srcdir=`dirname $0`
|
|
3 |
+srcdir=`dirname "$0"`
|
|
4 | 4 |
test -z "$srcdir" && srcdir=.
|
5 | 5 |
|
6 | 6 |
ORIGDIR=`pwd`
|
7 |
-cd $srcdir
|
|
7 |
+cd "$srcdir"
|
|
8 | 8 |
|
9 | 9 |
autoreconf -v --install || exit 1
|
10 |
-cd $ORIGDIR || exit $?
|
|
10 |
+cd "$ORIGDIR" || exit $?
|
|
11 | 11 |
|
12 |
-$srcdir/configure --enable-maintainer-mode "$@"
|
|
12 |
+git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
|
|
13 |
+ git config --local format.subjectPrefix "PATCH app/xinput"
|
|
13 | 14 |
|
15 |
+if test -z "$NOCONFIGURE"; then
|
|
16 |
+ exec "$srcdir"/configure "$@"
|
|
17 |
+fi
|
... | ... | @@ -22,8 +22,8 @@ |
22 | 22 |
|
23 | 23 |
# Initialize Autoconf
|
24 | 24 |
AC_PREREQ([2.60])
|
25 |
-AC_INIT([xinput], [1.6.2],
|
|
26 |
- [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xinput])
|
|
25 |
+AC_INIT([xinput], [1.6.3],
|
|
26 |
+ [https://gitlab.freedesktop.org/xorg/app/xinput/issues], [xinput])
|
|
27 | 27 |
AC_CONFIG_SRCDIR([Makefile.am])
|
28 | 28 |
AC_CONFIG_HEADERS([config.h])
|
29 | 29 |
|
1 |
-xinput (1.6.2-2) UNRELEASED; urgency=medium
|
|
1 |
+xinput (1.6.3-1) unstable; urgency=medium
|
|
2 | 2 |
|
3 |
+ [ Julien Cristau ]
|
|
3 | 4 |
* Switch all xorg.freedesktop.org URLs in packaging to https.
|
4 | 5 |
|
5 |
- -- Julien Cristau <jcristau@debian.org> Sun, 21 Aug 2016 18:09:06 +0200
|
|
6 |
+ [ Timo Aaltonen ]
|
|
7 |
+ * New upstream release.
|
|
8 |
+ * control: Use debhelper-compat, bump to 12.
|
|
9 |
+ * control: Update Vcs urls.
|
|
10 |
+ * control: Bump policy to 4.5.0.
|
|
11 |
+ * watch: Update git url.
|
|
12 |
+ |
|
13 |
+ -- Timo Aaltonen <tjaalton@debian.org> Tue, 24 Mar 2020 12:26:01 +0200
|
|
6 | 14 |
|
7 | 15 |
xinput (1.6.2-1) unstable; urgency=medium
|
8 | 16 |
|
1 |
-9
|
... | ... | @@ -2,10 +2,9 @@ Source: xinput |
2 | 2 |
Section: x11
|
3 | 3 |
Priority: optional
|
4 | 4 |
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
|
5 |
-Standards-Version: 3.9.6
|
|
5 |
+Standards-Version: 4.5.0
|
|
6 | 6 |
Build-Depends:
|
7 |
- debhelper (>= 9),
|
|
8 |
- dh-autoreconf,
|
|
7 |
+ debhelper-compat (= 12),
|
|
9 | 8 |
libx11-dev,
|
10 | 9 |
libxi-dev (>= 2:1.5.99.1),
|
11 | 10 |
libxext-dev,
|
... | ... | @@ -13,11 +12,9 @@ Build-Depends: |
13 | 12 |
libxrandr-dev,
|
14 | 13 |
x11proto-input-dev (>= 2.1.99.1),
|
15 | 14 |
pkg-config,
|
16 |
- automake,
|
|
17 |
- autoconf,
|
|
18 | 15 |
xutils-dev
|
19 |
-Vcs-Git: git://anonscm.debian.org/git/pkg-xorg/app/xinput
|
|
20 |
-Vcs-Browser: https://anonscm.debian.org/cgit/pkg-xorg/app/xinput.git
|
|
16 |
+Vcs-Git: https://salsa.debian.org/xorg-team/app/xinput.git
|
|
17 |
+Vcs-Browser: https://salsa.debian.org/xorg-team/app/xinput
|
|
21 | 18 |
|
22 | 19 |
Package: xinput
|
23 | 20 |
Architecture: any
|
1 | 1 |
#!/usr/bin/make -f
|
2 | 2 |
|
3 | 3 |
%:
|
4 |
- dh $@ --with autoreconf -Bbuild
|
|
4 |
+ dh $@ -Bbuild
|
|
5 | 5 |
|
6 | 6 |
override_dh_auto_configure:
|
7 | 7 |
dh_auto_configure -- \
|
1 |
-#git=git://anongit.freedesktop.org/xorg/app/xinput
|
|
1 |
+#git=https://gitlab.freedesktop.org/xorg/app/xinput
|
|
2 | 2 |
version=3
|
3 | 3 |
opts=pgpsigurlmangle=s/$/.sig/ \
|
4 |
-https://xorg.freedesktop.orgreleases/individual/app/ xinput-(.*)\.tar\.gz
|
|
4 |
+https://xorg.freedesktop.org/releases/individual/app/ xinput-(.*)\.tar\.gz
|
... | ... | @@ -87,7 +87,7 @@ instead. |
87 | 87 |
.B --set\-prop [\-\-type=\fIatom|float|int\fP] [\-\-format=\fI8|16|32\fP] \fIdevice\fP \fIproperty\fP \fIvalue\fP [...]
|
88 | 88 |
Set the property to the given value(s). If not specified, the format and type
|
89 | 89 |
of the property are left as-is. The arguments are interpreted according to the
|
90 |
-property type.
|
|
90 |
+property type. See Section \fICHANGING PROPERTIES\fP.
|
|
91 | 91 |
.PP
|
92 | 92 |
.TP 8
|
93 | 93 |
.B --watch-props \fIdevice\fP
|
... | ... | @@ -171,6 +171,31 @@ device. |
171 | 171 |
.PP
|
172 | 172 |
\fIproperty\fP can be the property as a string or the Atom value.
|
173 | 173 |
.PP
|
174 |
+.SH "CHANGING PROPERTIES"
|
|
175 |
+When xinput should modify an existing driver property value, it is
|
|
176 |
+sufficient to provide the device name and property name as string, followed
|
|
177 |
+by the new value(s) of the property. For example:
|
|
178 |
+.IP
|
|
179 |
+\fBxinput set-prop "my device" "my prop" 1 2 3\fB
|
|
180 |
+ |
|
181 |
+.SH "XWAYLAND"
|
|
182 |
+Xwayland is an X server that uses a Wayland Compositor as backend.
|
|
183 |
+Xwayland acts as translation layer between the X protocol and the Wayland
|
|
184 |
+protocol but does not have direct access to the hardware. The X Input
|
|
185 |
+Extension devices created by Xwayland ("xwayland-pointer",
|
|
186 |
+"xwayland-keyboard", etc.) map to the Wayland protocol devices,
|
|
187 |
+not to physical devices.
|
|
188 |
+.PP
|
|
189 |
+These X Input Extension devices are only visible to other X clients
|
|
190 |
+connected to the same Xwayland process. Changing properties on Xwayland
|
|
191 |
+devices only affects the behavior of those clients. For example, disabling
|
|
192 |
+an Xwayland device with xinput does not disable the device in Wayland-native
|
|
193 |
+applications. Other changes may not have any effect at all.
|
|
194 |
+.PP
|
|
195 |
+In most instances, using xinput with an Xwayland device is indicative of a
|
|
196 |
+bug in a shell script and xinput will print a warning. Use the Wayland
|
|
197 |
+Compositor's native device configuration methods instead.
|
|
198 |
+ |
|
174 | 199 |
.SH "SEE ALSO"
|
175 | 200 |
X(__miscmansuffix__), xset(__appmansuffix__), xrandr(__appmansuffix__)
|
176 | 201 |
.SH COPYRIGHT
|
... | ... | @@ -138,7 +138,7 @@ static int list_xi1(Display *display, |
138 | 138 |
return EXIT_SUCCESS;
|
139 | 139 |
}
|
140 | 140 |
|
141 |
-#ifdef HAVE_XI2
|
|
141 |
+#if HAVE_XI2
|
|
142 | 142 |
/* also used from test_xi2.c */
|
143 | 143 |
void
|
144 | 144 |
print_classes_xi2(Display* display, XIAnyClassInfo **classes,
|
... | ... | @@ -371,7 +371,7 @@ list(Display *display, |
371 | 371 |
{
|
372 | 372 |
if (format == FORMAT_NONE)
|
373 | 373 |
format = FORMAT_LONG;
|
374 |
-#ifdef HAVE_XI2
|
|
374 |
+#if HAVE_XI2
|
|
375 | 375 |
if (xinput_version(display) == XI_2_Major)
|
376 | 376 |
{
|
377 | 377 |
XIDeviceInfo *info = xi2_find_device_info(display, argv[arg_dev]);
|
... | ... | @@ -399,7 +399,7 @@ list(Display *display, |
399 | 399 |
} else {
|
400 | 400 |
if (format == FORMAT_NONE)
|
401 | 401 |
format = FORMAT_SHORT;
|
402 |
-#ifdef HAVE_XI2
|
|
402 |
+#if HAVE_XI2
|
|
403 | 403 |
if (xinput_version(display) == XI_2_Major)
|
404 | 404 |
return list_xi2(display, format);
|
405 | 405 |
#endif
|
... | ... | @@ -610,19 +610,20 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char |
610 | 610 |
unsigned char *c;
|
611 | 611 |
int16_t *s;
|
612 | 612 |
int32_t *l;
|
613 |
- } data;
|
|
613 |
+ } data = { NULL };
|
|
614 |
+ int rc = EXIT_FAILURE;
|
|
614 | 615 |
|
615 | 616 |
if (argc < 3)
|
616 | 617 |
{
|
617 | 618 |
fprintf(stderr, "Usage: xinput %s %s\n", n, desc);
|
618 |
- return EXIT_FAILURE;
|
|
619 |
+ goto out;
|
|
619 | 620 |
}
|
620 | 621 |
|
621 | 622 |
info = xi2_find_device_info(dpy, argv[0]);
|
622 | 623 |
if (!info)
|
623 | 624 |
{
|
624 | 625 |
fprintf(stderr, "unable to find device %s\n", argv[0]);
|
625 |
- return EXIT_FAILURE;
|
|
626 |
+ goto out;
|
|
626 | 627 |
}
|
627 | 628 |
|
628 | 629 |
name = argv[1];
|
... | ... | @@ -631,7 +632,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char |
631 | 632 |
|
632 | 633 |
if (prop == None) {
|
633 | 634 |
fprintf(stderr, "invalid property '%s'\n", name);
|
634 |
- return EXIT_FAILURE;
|
|
635 |
+ goto out;
|
|
635 | 636 |
}
|
636 | 637 |
|
637 | 638 |
float_atom = XInternAtom(dpy, "FLOAT", False);
|
... | ... | @@ -643,7 +644,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char |
643 | 644 |
&bytes_after, &data.c) != Success) {
|
644 | 645 |
fprintf(stderr, "failed to get property type and format for '%s'\n",
|
645 | 646 |
name);
|
646 |
- return EXIT_FAILURE;
|
|
647 |
+ goto out;
|
|
647 | 648 |
} else {
|
648 | 649 |
if (type == None)
|
649 | 650 |
type = old_type;
|
... | ... | @@ -657,7 +658,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char |
657 | 658 |
if (type == None) {
|
658 | 659 |
fprintf(stderr, "property '%s' doesn't exist, you need to specify "
|
659 | 660 |
"its type and format\n", name);
|
660 |
- return EXIT_FAILURE;
|
|
661 |
+ goto out;
|
|
661 | 662 |
}
|
662 | 663 |
|
663 | 664 |
data.c = calloc(nelements, sizeof(int32_t));
|
... | ... | @@ -678,43 +679,45 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char |
678 | 679 |
break;
|
679 | 680 |
default:
|
680 | 681 |
fprintf(stderr, "unexpected size for property %s", name);
|
681 |
- return EXIT_FAILURE;
|
|
682 |
+ goto out;
|
|
682 | 683 |
}
|
683 | 684 |
} else if (type == float_atom) {
|
684 | 685 |
if (format != 32) {
|
685 | 686 |
fprintf(stderr, "unexpected format %d for property '%s'\n",
|
686 | 687 |
format, name);
|
687 |
- return EXIT_FAILURE;
|
|
688 |
+ goto out;
|
|
688 | 689 |
}
|
689 | 690 |
*(float *)(data.l + i) = strtod(argv[2 + i], &endptr);
|
690 | 691 |
if (endptr == argv[2 + i]) {
|
691 | 692 |
fprintf(stderr, "argument %s could not be parsed\n", argv[2 + i]);
|
692 |
- return EXIT_FAILURE;
|
|
693 |
+ goto out;
|
|
693 | 694 |
}
|
694 | 695 |
} else if (type == XA_ATOM) {
|
695 | 696 |
if (format != 32) {
|
696 | 697 |
fprintf(stderr, "unexpected format %d for property '%s'\n",
|
697 | 698 |
format, name);
|
698 |
- return EXIT_FAILURE;
|
|
699 |
+ goto out;
|
|
699 | 700 |
}
|
700 | 701 |
data.l[i] = parse_atom(dpy, argv[2 + i]);
|
701 | 702 |
} else {
|
702 | 703 |
fprintf(stderr, "unexpected type for property '%s'\n", name);
|
703 |
- return EXIT_FAILURE;
|
|
704 |
+ goto out;
|
|
704 | 705 |
}
|
705 | 706 |
}
|
706 | 707 |
|
707 | 708 |
XIChangeProperty(dpy, info->deviceid, prop, type, format, PropModeReplace,
|
708 | 709 |
data.c, nelements);
|
710 |
+ rc = EXIT_SUCCESS;
|
|
711 |
+out:
|
|
709 | 712 |
free(data.c);
|
710 |
- return EXIT_SUCCESS;
|
|
713 |
+ return rc;
|
|
711 | 714 |
}
|
712 | 715 |
#endif
|
713 | 716 |
|
714 | 717 |
int list_props(Display *display, int argc, char *argv[], char *name,
|
715 | 718 |
char *desc)
|
716 | 719 |
{
|
717 |
-#ifdef HAVE_XI2
|
|
720 |
+#if HAVE_XI2
|
|
718 | 721 |
if (xinput_version(display) == XI_2_Major)
|
719 | 722 |
return list_props_xi2(display, argc, argv, name, desc);
|
720 | 723 |
#endif
|
... | ... | @@ -725,7 +728,7 @@ int list_props(Display *display, int argc, char *argv[], char *name, |
725 | 728 |
int delete_prop(Display *display, int argc, char *argv[], char *name,
|
726 | 729 |
char *desc)
|
727 | 730 |
{
|
728 |
-#ifdef HAVE_XI2
|
|
731 |
+#if HAVE_XI2
|
|
729 | 732 |
if (xinput_version(display) == XI_2_Major)
|
730 | 733 |
return delete_prop_xi2(display, argc, argv, name, desc);
|
731 | 734 |
#endif
|
... | ... | @@ -736,7 +739,7 @@ int delete_prop(Display *display, int argc, char *argv[], char *name, |
736 | 739 |
static int
|
737 | 740 |
do_set_prop(Display *display, Atom type, int format, int argc, char *argv[], char *name, char *desc)
|
738 | 741 |
{
|
739 |
-#ifdef HAVE_XI2
|
|
742 |
+#if HAVE_XI2
|
|
740 | 743 |
if (xinput_version(display) == XI_2_Major)
|
741 | 744 |
return do_set_prop_xi2(display, type, format, argc, argv, name, desc);
|
742 | 745 |
#endif
|
... | ... | @@ -358,6 +358,10 @@ test_xi2(Display *display, |
358 | 358 |
if (argc >= 1) {
|
359 | 359 |
XIDeviceInfo *info;
|
360 | 360 |
info = xi2_find_device_info(display, argv[0]);
|
361 |
+ /* info is alway valid, the list() call exits if the device
|
|
362 |
+ cannot be found, but let's shut up coverity */
|
|
363 |
+ if (!info)
|
|
364 |
+ return EXIT_FAILURE;
|
|
361 | 365 |
deviceid = info->deviceid;
|
362 | 366 |
}
|
363 | 367 |
|
... | ... | @@ -376,7 +380,7 @@ test_xi2(Display *display, |
376 | 380 |
XISetMask(m->mask, XI_Leave);
|
377 | 381 |
XISetMask(m->mask, XI_FocusIn);
|
378 | 382 |
XISetMask(m->mask, XI_FocusOut);
|
379 |
-#ifdef HAVE_XI22
|
|
383 |
+#if HAVE_XI22
|
|
380 | 384 |
XISetMask(m->mask, XI_TouchBegin);
|
381 | 385 |
XISetMask(m->mask, XI_TouchUpdate);
|
382 | 386 |
XISetMask(m->mask, XI_TouchEnd);
|
... | ... | @@ -394,7 +398,7 @@ test_xi2(Display *display, |
394 | 398 |
XISetMask(m->mask, XI_RawButtonPress);
|
395 | 399 |
XISetMask(m->mask, XI_RawButtonRelease);
|
396 | 400 |
XISetMask(m->mask, XI_RawMotion);
|
397 |
-#ifdef HAVE_XI22
|
|
401 |
+#if HAVE_XI22
|
|
398 | 402 |
XISetMask(m->mask, XI_RawTouchBegin);
|
399 | 403 |
XISetMask(m->mask, XI_RawTouchUpdate);
|
400 | 404 |
XISetMask(m->mask, XI_RawTouchEnd);
|
... | ... | @@ -273,7 +273,7 @@ find_device_info(Display *display, |
273 | 273 |
return found;
|
274 | 274 |
}
|
275 | 275 |
|
276 |
-#ifdef HAVE_XI2
|
|
276 |
+#if HAVE_XI2
|
|
277 | 277 |
Bool is_pointer(int use)
|
278 | 278 |
{
|
279 | 279 |
return use == XIMasterPointer || use == XISlavePointer;
|
... | ... | @@ -361,6 +361,26 @@ usage(void) |
361 | 361 |
}
|
362 | 362 |
}
|
363 | 363 |
|
364 |
+static Bool
|
|
365 |
+is_xwayland(Display *dpy)
|
|
366 |
+{
|
|
367 |
+ XDeviceInfo *devices;
|
|
368 |
+ int n;
|
|
369 |
+ Bool is_xwayland = False;
|
|
370 |
+ |
|
371 |
+ devices = XListInputDevices(dpy, &n);
|
|
372 |
+ while (n-- > 0) {
|
|
373 |
+ if (strncmp(devices[n].name, "xwayland-", 9) == 0) {
|
|
374 |
+ is_xwayland = True;
|
|
375 |
+ break;
|
|
376 |
+ }
|
|
377 |
+ }
|
|
378 |
+ |
|
379 |
+ XFreeDeviceList(devices);
|
|
380 |
+ |
|
381 |
+ return is_xwayland;
|
|
382 |
+}
|
|
383 |
+ |
|
364 | 384 |
int
|
365 | 385 |
main(int argc, char * argv[])
|
366 | 386 |
{
|
... | ... | @@ -402,6 +422,9 @@ main(int argc, char * argv[]) |
402 | 422 |
goto out;
|
403 | 423 |
}
|
404 | 424 |
|
425 |
+ if (is_xwayland(display))
|
|
426 |
+ fprintf(stderr, "WARNING: running xinput against an Xwayland server. See the xinput man page for details.\n");
|
|
427 |
+ |
|
405 | 428 |
while(driver->func_name) {
|
406 | 429 |
if (strcmp(driver->func_name, func) == 0) {
|
407 | 430 |
int r = (*driver->func)(display, argc-2, argv+2,
|
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 |
|
28 | 28 |
#include <X11/Xlib.h>
|
29 | 29 |
#include <X11/extensions/XInput.h>
|
30 |
-#ifdef HAVE_XI2
|
|
30 |
+#if HAVE_XI2
|
|
31 | 31 |
#include <X11/extensions/XInput2.h>
|
32 | 32 |
#endif
|
33 | 33 |
#include <X11/Xutil.h>
|