Commit graph

30 commits

Author SHA1 Message Date
Peter Hutterer
12021c860e tools: debug-gui: show pressure/distance as vertical bar
Both of these are normalized so let's draw a bar that shows the values
accordingly. This makes it a lot easier to check whether pressure values go to
the maximum, etc.

A little extra square is shown whenever the tip is logically down.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-01 08:38:59 +10:00
Peter Hutterer
1e6802b91b Remove some usage of libinput-util.h
Positive side-effect - this exposed a bunch of missing #includes that got
pulled in by other headers before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-11 12:23:06 +10:00
Peter Hutterer
6a489b0636 tools: return 77 if gtk_init() fails in the debug-gui
And when that happens, skip the tests because what's happening here is that
you're running tests as root, but your X server doesn't allow root to connect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-26 21:09:22 +10:00
Peter Hutterer
8bfa1aa086 tools: handle pad strip/ring events in the debug-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-13 11:02:42 +10:00
Peter Hutterer
e439d740f0 tools: display tablet and tablet pad buttons when pressed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-13 11:02:42 +10:00
Peter Hutterer
17d792445e tablet: add a the Totem tool type to the tablet interface
This is the public API only, not the internal bits, so nothing will work just
yet.

This interface addition is for the Dell Canvas Totem tool, so let's go with
the same name because options like "Rotary" are too ambiguous.

The totem is a knob that can be placed on the surface, it provides us with
location and rotation data. The touch major/minor fields are filled in by the
current totem, but they're always the same size.

The totem exports BTN_0 as well, so let's add that to the debug-events output.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-07 01:03:21 +00:00
Peter Hutterer
1150a8442f tools: display the discrete axis steps too
Draw a second smaller scroll bar that moves with every discrete step. For that
to work, we have to accumulate the value from the normal scroll events until
we get the first discrete one, then move up.

The value per discrete event changes depending on the click wheel angle, so we
can't just use discrete on its own if we want the two scroll bars aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
d213804de8 tools: group the scroll bits into a struct
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
e0008d3dc2 tools: debug-gui: change the tablet color
Grey isn't pretty enough

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:08:51 +10:00
Peter Hutterer
f954cb29e4 tools: debug-gui: add a previously unbalanced cairo_restore()
And remove some of the unnecessary ones

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:02:13 +10:00
Peter Hutterer
c1ee05fb9a tools: debug-gui: move the pointer delta code to draw_pointer
Not sure why this was in draw_tablet(), probably copy/paste

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:02:13 +10:00
Peter Hutterer
e038a22360 tools: draw the tablet before the touch points
On the Dell Canvas Totem, the tool will cancel existing touch points and to
visually debug that, we need the touchpoints to be drawn over the tool.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 18:45:04 +10:00
Peter Hutterer
5b85cf06d8 tools: draw other buttons in the debug-gui
Buttons that aren't lmr are drawn in a separate button square now with the
name as it comes from the kernel. This only handles one button at a time, but
it'll do for debugging.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
335fe99a32 tools: debug-gui: move the lmr button handling into a substruct
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
790a301d13 tools: debug-gui: show cancelled touches as unfilled circles
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
96a0e8ed66 tools: don't apply config options on device removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-12-19 15:55:42 +10:00
Peter Hutterer
b033bc2677 tools: draw evdev events in the debug-gui
Listen to the pure evdev events from each device and print them. This makes it
slightly easier to associate certain jumps with the output, or otherwise see
that events are coming in even when libinput doesn't seem to process them
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 15:22:20 +10:00
Peter Hutterer
4e469291b1 tools: let debug-events take a device path
This is the most common use-case other than "all from udev", so let's just
parse a device path correctly without requiring --device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
36af7d312b tools: make the tools exit with exit code 2 on usage issues
This makes it easier to test for usage issues

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
22890a4719 tools: handle sigint in debug-gui
Exit with success on SIGINT

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
e640bac867 tools: fix grab handling in libinput debug-gui
The libinput context's user_data was used for deciding whether to grab the
event device but also to hold the struct window data for the debug-gui. Worked
fine for the initial batch of devices, but any device coming in late would
just use the first field of the struct window to decide whether to grab or
not.

Fixes #122

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 17:04:51 +10:00
Peter Hutterer
f78d6669e5 tools: debug-*: show unaccelerated deltas for pointer events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-08 10:07:43 +10:00
Peter Hutterer
0a13223c39 tools: fix grab argument passing for libinput debug-events
The &grab pointer we used to pass as userdata was the address of the function
argument which goes out of scope at the end of the function. This works fine
for devices immediately opened but when a device connects later, the address
may have been re-used since and it's content is undefined. If not NULL, we
end up grabbing the device.

Instead pass the grab option in which is guaranteed to live until the end of
main.

https://gitlab.freedesktop.org/libinput/libinput/issues/26

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 09:50:29 +10:00
Peter Hutterer
4c31a1a285 tools: debug-gui: add some extra targets for pointer acceleration testing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:18:58 +10:00
Greg V
8adfac3975 Include stdarg.h where variadic functions are used
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-01 09:31:42 +10:00
Peter Hutterer
f7cfc2bbbb tools: restore option handling for the debug gui
window_init zeroes out the struct and loses any option parsing done before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05 10:41:27 +10:00
Peter Hutterer
d1b7b6267c tools: split the configuration option parsing out
We had one shared parsing function for all config options so tools parse
options that don't actually make sense (e.g. --quiet or --show-keycodes for
libinput-list-devices).

This patch splits the actual libinput device configuration out and reshuffles
everything to make use of that. One large patch, because splitting this up is
more confusing than dumping it all.

This means the actual option parsing is partially duplicated between debug-gui
and debug-events but hey, not everything in life is perfect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-26 18:43:59 +10:00
Peter Hutterer
7e57123069 tools: grab the pointer in the debug gui
Because it's too annoying to trigger the hot corner every few seconds while
pointer debugging.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-15 17:46:51 +10:00
Peter Hutterer
2d42e87deb tools: tidy up the usage() for the tools a bit
Now that the debug-gui is a user-visible tool, make sure the usage reflects
the right command name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Peter Hutterer
a69294251d Fold the event-gui into the libinput tool
It's common enough for users to want to debug libinput behavior without
interference by the compositor or the X server. Being able to run a GUI
without having to compile from git is helpful.

Note that this changes --enable-event-gui autotools option to
--enable-debug-gui and the event-gui mesonconf option to debug-gui.

This also drops the standalone event-gui binary in both autotools and meson.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02 12:21:35 +10:00
Renamed from tools/event-gui.c (Browse further)