| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
We only touch src and tools, imported headers from include are not ours
to change.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
| |
On Sway, and probably other Wayland compositors based on wlroots, the
window_lock_pointer() was called twice.
Avoid errors when window_lock_pointer() is invoked multiple times.
Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/808
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have two different dependencies on Wayland: GTK support and the
wayland-protocols we use directly. If we have GTK support but
wayland-protocols is not installed at meson configure time, our build
fails.
To avoid having multiple ifdefs in the code, let's define two new ones:
HAVE_GTK_WAYLAND and HAVE_GTK_X11, both set if GTK supports that
particular target (from pkgconfig) and we have the other support
libraries we need.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
All cases we have in our code base have an otherwise unused variable to
loop through the array. Let's auto-declare this as part of the loop.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting with kernel v5.0 two new axes are available for high-resolution wheel
scrolling: REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES. Both axes send data in
fractions of 120 where each multiple of 120 amounts to one logical scroll
event. Fractions of 120 indicate a wheel movement less than one detent.
This commit adds a new API for scroll events. Three new event types that encode
the axis source in the event type name and a new API to get a normalized-to-120
value that also used by Windows and the kernel (each multiple of 120 represents
a logical scroll click).
This addresses a main shortcoming with the existing API - it was unreliable to
calculate the click angle based on the axis value+discrete events and thus any
caller using the axis value alone would be left with some ambiguity. With the
v120 API it's now possible to (usually) calculate the click angle, but more
importantly it provides the simplest hw-independent way of scrolling by a
click or a fraction of a click.
A new event type is required, the only way to integrate the v120 value
otherwise was to start sending events with a discrete value of 0. This
would break existing xf86-input-libinput (divide by zero, fixed in 0.28.2) and
weston (general confusion). mutter, kwin are unaffected.
With the new API, the old POINTER_AXIS event are deprecated - callers should use
the new API where available and discard any POINTER_AXIS events.
Notable: REL_WHEEL/REL_HWHEEL are emulated by the kernel but there's no
guarantee that they'll come every accumulated 120 values, e.g. Logitech mice
often send events that don't add up to 120 per detent.
We use the kernel's wheel click emulation instead of doing our own.
libinput guarantees high-resolution events even on pre-5.0 kernels.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
| |
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
| |
Use the pointer constraints protocol to lock the pointer on Wayland.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Global:
- Stop passing commandline arguments to gtk_init:
https://docs.gtk.org/gtk4/migrating-3to4.html#stop-passing-commandline-arguments-to-gtk_init
window_init function:
- gtk_window_new doesn't require a type anymore
- gtk_window_iconify has been renamed to gtk_window_minimize
- gtk_container_add has been removed in favor of container specific
APIs. Use gtk_window_set_child in this case.
- gtk_widget_show_all has been removed, widgets are now visible by
default:
https://docs.gtk.org/gtk4/migrating-3to4.html#widgets-are-now-visible-by-default
- gtk_widget_set_events to NULL is no longer required, widgets must set
their event handlers explicitly now:
https://blog.gtk.org/2020/04/29/custom-widgets-in-gtk-4-input/
window_delete_event_cb function:
- Use the new close-request event:
https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-gtkwidget-event-signals
map_event_cb function:
- gtk_widget_set_cursor_from_name instead of gdk_window_set_cursor
- Wait until the draw area is resized to use the whole window to start
calculating sizes
window_place_ui_elements function:
- Use gtk_widget_get_width and gtk_widget_get_height instead of
gtk_window_get_size
Drawing:
- Use gtk_drawing_area_set_draw_func instead of the GtkWidget::draw
signal:
https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-drawing-model-changes
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Move the code used to pace the different UI elements to its own
function.
Refactor, no functional changes.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
| |
Migrate to GMainLoop because gtk_main is deprecated in GTK 4.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
| |
Wrap the calls to gtk_main_quit in its own function.
Refactor, no functional changes.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
| |
This has recently been endorsed by the linux kernel, it should be good
enough for us.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
Add hold gestures to the public API and the private functions to notify them.
Also add hold gestures to debug-events and debug-gui.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
| |
Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
|
|
|
|
| |
Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
|
|
|
|
|
|
|
|
|
| |
Add a second grey v-shaped (upside down triangle) pointer that moves around
with the unaccelerated deltas. This makes it easier to visualize how the
unaccelerated pointer moves around, the snake helps for some use-cases but not
all of them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional change
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
The messages with priority DEBUG refer to the various internal state machines
updating, so it's useful to know when they did so. Let's count up every time
we trigger libinput_dispatch() so we know how the messages group together.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
This is a closer approximation of all callers anyway, and it makes it easier
to debug which events are handled per libinput_dispatch() call.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
This allows us to run the option parsing test without getting interrupted by a
million debug-gui windows popping up for half a second.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
This shuts up scan-build complaining about memory leaks in libinput
debug-events (needs the right combination of --device option and eventually
triggering usage()) and saves us a bunch of unnecessary allocations.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Wacom Cintiq 24HD and later tablets send specific key events for
hardware/soft buttons. KEY_PROG1..KEY_PROG3 on earlier tablets,
KEY_CONTROLPANEL, KEY_ONSCREEN_DISPLAY, and KEY_BUTTONCONFIG on later tablets.
We ignore KEY_PROG1-3 because starting with kernel 5.4 older tablets will too
use the better-named #defines.
These differ from pad buttons as the key code in itself carries semantic
information, so we should pass them on as-is instead of mapping them to
meaningless 0-indexed buttons like we do on the other buttons.
So let's add a new event, LIBINPUT_EVENT_TABLET_PAD_KEY and the associated
functions to handle that case.
Pad keys have a fixed hw-defined semantic meaning and are thus not part of
a tablet mode group.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
For interaction between devices it's necessary to look at more than one device
at a time.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Grey isn't pretty enough
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
And remove some of the unnecessary ones
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Not sure why this was in draw_tablet(), probably copy/paste
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
No functional changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
This makes it easier to test for usage issues
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Exit with success on SIGINT
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|