Commit graph

517 commits

Author SHA1 Message Date
Peter Hutterer
33c49dc125 wacom: Check for the right output connector name
Otherwise we just return the first output with the corresponding vendor
and serial number.

Fixes: 75ce02e202 ("wacom: Provide connector name for disambiguation")
2024-03-22 13:02:22 +00:00
Peter Hutterer
ebd2b013dd wacom: Accept 4-value output settings
We now store the connector name as fourth value.

Fixes: 75ce02e202 ("wacom: Provide connector name for disambiguation")
2024-03-22 13:02:22 +00:00
Jakub Steiner
6718390123 wacom: adjust graphic
- all the pen assets have no padding inside the SVG itself
- round the shape a little
2024-03-11 16:53:12 +00:00
Peter Hutterer
8b45201b9c wacom: Accept eraser types of button when matching stylus IDs
Unlike tip erasers, styli with eraser buttons (which is the vast
majority anyway) have the same tool ID as the pen so the first
matching stylus we find is the right one.

This avoid a warning when a AES stylus is connected - we're constructing
the stylus based on our cache information which is just ID and serial
but no device - meaning the device lookup cannot work.

Fixes: 42b39cb956 ("wacom: Prefer the stylus over the eraser")
2024-03-11 16:53:12 +00:00
Peter Hutterer
f1cfc55a63 wacom: Add AES styli as separate stylus SVG
These are styli like the Dell Active Pen and most of the styli supplied
with laptops with built-in tablets. We don't always know how many
buttons these have so the SVG has just one large button. They're
typicall slimmer and less rounded than the Wacom pens so let's reflect
this here too.

This requires libwacom 1.4 released June 2020
2024-03-11 16:53:12 +00:00
Peter Hutterer
d8cb742c6d wacom: Remove an outdated ifdef
libwacom 0.27 was released in 2017, I think we can rely on having that
version now.
2024-03-06 09:11:10 +00:00
Automeris naranja
ec30d48a12 wacom: Port "Keep Aspect Ratio" row to AdwSwitchRow 2024-02-29 10:18:47 +00:00
Peter Hutterer
b45550770e wacom: Fix a memleak on error
In the case of an error we allocated the object but returned NULL
without freeing it.
2024-02-29 09:44:22 +00:00
Peter Hutterer
2aa192f8cf wacom: Change a boolean to the enum value it actually is
Happens to be a value of zero so FALSE works, but only because this is C
and nothing is true and everything is permitted.
2024-02-29 09:44:22 +00:00
Peter Hutterer
c348239e92 wacom: Pass the GsdDevice through to the calibrator
The calibrator gets a GdkDevice from the GtkGesture but that device is
the "Logical device for $TABLET", not the actual device. So all our
clicks are discarded as coming from the wrong device.

Fix this by passing the GsdDevice through and comparing against that.

Closes #1871
2024-02-19 12:47:09 +01:00
Peter Hutterer
430585eed0 wacom: Fix a few indentation/whitespace issues 2024-02-19 12:46:06 +01:00
Peter Hutterer
1d8f9a3504 wacom: Switch dialog to a AdwPreferencesRow 2024-02-11 08:48:38 +01:00
Peter Hutterer
fcab974558 wacom: Add mnemonics to the stylus button assignments 2024-02-11 08:48:38 +01:00
Peter Hutterer
ad63caf442 wacom: Switch to using a dialog for stylus button assignments
This moves the wacom stylus button assignments from a dropdown to an
external dialog, in preparation for adding keyboard shortcuts to this
list.
2024-02-11 08:48:37 +01:00
Peter Hutterer
605914911a wacom: Clear the stylus highlight after a timeout 2024-02-10 21:55:41 +00:00
Peter Hutterer
c5ee557eb9 wacom: Highlight the currently active stylus
This duplicates the SVG images for the styli with the only change being
the fill colour (#d3d7cf to #3584e4).

Closes #2464
2024-02-10 21:55:41 +00:00
Peter Hutterer
9770c6f382 wacom: Give proper ids and classes to the stylus SVG components
The images for the styli include a stylus and some buttons, so
creatively name the components after that.
2024-02-10 21:55:41 +00:00
Peter Hutterer
e5172d04bd wacom: Update struct field indentation
Preparation for a new field that requires this indentation, split out to
make the actual patch easier to review.
2024-02-10 21:55:41 +00:00
Peter Hutterer
2365a6fa07 wacom: Sort the gresources stylus SVGs alphabetically-ish 2024-02-10 21:55:41 +00:00
Peter Hutterer
f6d1ae869d wacom: Cast to GTK_WIDGET, keep the CcWacomStylusPage type 2024-02-10 21:55:41 +00:00
Carlos Garnacho
75ce02e202 wacom: Provide connector name for disambiguation
Provide the connector name as the fourth value in the
tablet's output setting. With recent Mutter, this will
allow disambiguating the mapped output if there happens
to be multiple outputs with the same EDID data.
2024-02-06 09:20:01 +00:00
Monster
045e9cd28d wacom: Remove periods from descriptions 2024-02-05 10:54:29 +00:00
Carlos Garnacho
dac9065dc3 wacom: Drop list to handle pads
This has effectively become a group of one. We can
keep the pad device pointer as well.
2024-02-05 09:49:21 +00:00
Carlos Garnacho
d4d0c60fc7 wacom: Pair only builtin pads with tablets
Pad and tablet grouping has become more irrelevant to the
Settings UI since commit 39402f21ba, as the EKR is the only
known case of an additional pad with distinct vendor/product
that is tied to another device.

But we preserved the grouping of pads (for the tablet EKRs
get paired with), thus possibly still requesting the pad OSD
to be shown on one of these arbitrarily.

In order to ensure that each "Map Buttons..." button in the
UI goes to the right pad being mapped, drop this grouping of
tablets, and make a CcWacomPage only observe a stylus/pad
pair in the same group (i.e. belonging to the same device, if
multiple similar ones are plugged) and with the same vendor+product
(i.e. coming from the same device).

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2876
2024-02-05 09:49:21 +00:00
Peter Hutterer
cc7aff9cb2 wacom: Add missing mnemonics
Partially fixes #2541
2024-02-05 09:12:57 +00:00
Peter Hutterer
95248cd906 wacom: Return has_eraser again as libwacom intended
libwacom_has_eraser tells us if this non-eraser tool has an
associated eraser (same serial, different tool id)
libwacom_is_eraser tells us if the current tool is an eraser device.

Now that we always have the stylus for the tool in proximity (see the
previous commit), switch this back to the has_eraser function and
rename it in the process so it's more obviously not the seemingly
obvious interpretation.

This reverts commit 9bd0b94527.
2024-02-05 08:30:26 +00:00
Peter Hutterer
42b39cb956 wacom: Prefer the stylus over the eraser
Pens with an integrated eraser share the serial number with the
corresponding pen but differ in the tool ID. libwacom provides a
"paired_id" mapping to look up one from the other.

If the user brings the eraser into proximity the very first time the
tool is seen, the eraser's tool ID is stored in the keyfile instead of
the associated stylus id. This leads to otherwise wrong behavior since
erasers share the serial number with the stylus but don't have any
buttons, don't have any erasers themselves, etc.

Fix this by looking up a matching stylus when we see an eraser. This
effectively filters our CcWacomTool to always be the pen, which is an
inadvertent assumption anyway.
2024-02-05 08:30:26 +00:00
Peter Hutterer
c5dc74f8b6 wacom: The only stylus with rotation is the Art pen 2024-01-24 09:50:15 +00:00
Peter Hutterer
e8c1e0e778 wacom: Don't call the standard styli "Standard stylus"
The overwhelmingly vast majority of users will never see anything else
than a "Standard" (i.e. pen-shaped) stylus. And there's a mismatch
between e.g. the Pro Pen 3 being labeled as "Standard stylus" when users
spent money on getting a Pro pen.

Let's drop the "Standard" prefix, it adds nothing in this context.
2024-01-24 09:50:15 +00:00
Hari Rana
d0bcdc9645 wacom: Port to AdwSwitchRow 2024-01-22 09:08:43 +00:00
Peter Hutterer
e53cc1f69b wacom: Mark the center-point of the stylus pressure curve 2023-12-21 09:23:49 +00:00
Peter Hutterer
815bd93943 wacom: Simplify the algorithm a bit
Now that our first and last configuration points are 0/100 and 100/0
respectively, we can simplify the calculation a bit. Doubly so because
p2 is just a mirror of p1.

That with extending the slider range to 200 means we get a value for
each integer combination on our pressurecurves - which in turn means
that for any of our generated curves we get a slider value return.
2023-12-21 09:23:49 +00:00
Peter Hutterer
b76a7e06b2 wacom: Extend the pressurecurve range by 25% in each direction
Now that we have a smooth range of curves we can extend the curve
into the maximum range we can support given 0 < x|y < 100.
2023-12-21 09:23:49 +00:00
Peter Hutterer
7814309ee9 wacom: Generate a smooth pressure curve instead of just 7
Our previously hardcoded pressurecurves follow a predictable
pattern so we can generate the value on-the-fly based on that pattern.
The slider now uses a range of 100 (integer) values and calculates the
matching pressure curve based on that. The actual pressure curve remains
the same for previous values.

However, the functions are lossy thanks to CLAMP() so figuring out
a slider position from points requires heuristics: for each of the four
coordinates we calculate a slider value. Then we calculate the points
for that slider value and if those calculated points match ours then we
have a winner.
2023-12-21 09:23:49 +00:00
Peter Hutterer
2bfd36c362 wacom: Use the ExpressKey Remote name for the EKR
There's only one device like this that we support so we might as well
use its name as-is instead of a more confusing "External Pad device"
which isn't very descriptive unless you work with tablets and know what
a "pad" is in this context.

Anyone who owns this device will have bought it under the name
ExpressKey remote.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2044
2023-11-08 08:51:56 +00:00
Jakub Steiner
d9b4903baf wacom: Update illustration style
- refresh the style to fit with the new libadwaita/gtk4 style

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1616
2023-10-24 14:38:00 +00:00
Sabri Ünal
6a4a70f6a6 data: mark translatable strings yes
Marking translatable strings as 'yes' is a convenient practice
across the GNOME project. Follow the common practice.
2023-09-18 00:31:24 +03:00
Alice Mikhaylenko
79fe6067ee wacom: Ellipsize the test button 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
4680f362f3 Port to AdwNavigationSplitView 2023-08-25 08:00:43 +00:00
Christopher Davis
f50cf970ac wacom: Port to AdwToolbarView 2023-08-25 08:00:43 +00:00
Marcos Miller
61955e46d0 general: replace gtk_widget_translate_coordinates
The method gtk_widget_translate_coordinates is deprecated in gtk 4.12.
Use a new method gtk_widget_compute_point instead.

general: Apply suggestions graphene point
2023-07-21 09:14:20 +00:00
Robert Ancell
d90d3ffdfa wacom: Connect signal handlers in swapped form 2023-06-07 09:14:28 +12:00
Robert Ancell
9020cfb1a3 wacom: Use self for object variable name 2023-06-06 07:54:38 +00:00
Robert Ancell
543f24a754 wacom: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
Pablo Correa Gómez
7f7b65545c all: meson: do not specify resources from gresource files as dependencies
Meson extracts them by itself and add them as dependencies for the target.
It means one less location to keep track of files, and a lot less boilerplate
around the meson files
2023-05-24 08:34:14 +00:00
Chris Mayo
bd6c61ab06 wacom: Fix WacomPage crash due to unknown type in UI description
Error building template class 'CcWacomPage' for an instance of type 'CcWacomPage': .:0:0 Invalid object type 'CcListRow'
2023-04-17 12:14:58 +00:00
Maksym Hazevych
08c2e69851 Resolving suggestions 2023-03-29 14:26:55 +13:00
Maksym Hazevych
e00f773b2f Remove unnecessary visibility change 2023-03-29 14:26:55 +13:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00