Commit graph

491 commits

Author SHA1 Message Date
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
Automeris naranja
65734339c2 wacom: Rename "Test Your Settings" button to "Test Settings"
The same change was made in the Mouse & Touchpad panel:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1486
2023-03-15 13:37:44 +00:00
Mohammed Sadiq
3b121805ed log: Improve logging
The 'tracing' build option is no longer needed.  And the verbosity
of logs can be set by providing '-v' multiple times.
2022-12-01 11:44:17 +00:00
Mohammed Sadiq
26fe10348e wacom: Use CcListRow for row with go-next icon 2022-11-25 20:52:28 +05:30
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Carlos Garnacho
92b784f561 wacom: Use Mutter's input mapping interface to show calibration UI
When the "Automatic" mapping is chosen for a display-attached tablet device,
Mutter is in charge of applying the heuristics to map the tablet device to
its most likely attached display.

When that happens, the Wacom panel does not know better (or anything)
to show the calibration UI than picking a GdkMonitor and hoping for the
best.

To improve this situation, Mutter has been added a D-Bus interface so it
is possible to query it for the output that a tablet device is mapped to.
This commit adds the support for this interface, so that the Wacom panel
does know to pick the right GdkMonitor to fullscreen the calibration UI on.
2022-09-01 23:14:07 +02:00
Carlos Garnacho
39402f21ba wacom: Show distinct entries for Wacom Express Key Remote
If you did not know the Wacom Express Key Remote (or EKR for short),
let me introduce it to you:

https://estore.wacom.com/media/catalog/product/cache/fb4143a007ae6439deba9b18afd745f2/a/c/ack-411050_main_2.jpg

This is a hand-sized standalone pad device, meant to be used together
with drawing tablets, providing additional buttons and a touch sensitive
ring that can be mapped to actions and keypresses.

These pads were so far handled in GNOME, but in a very subtle manner.
As the EKR is implicitly paired to a tablet, it was possible to map
EKR buttons from the paired tablet once the pad OSD UI from GNOME
Shell was shown.

As this device basically just needs a "Map buttons" action to
configure it, it just didn't sit well in the older Settings UI,
it would get a separate page with just a lone button in there. So
its support has been kind of an easter egg so far.

But the new UI can indeed accomodate better a device that is neither
tablet nor stylus, and has few options. This commit adds the EKR
as a separate AdwPreferencesGroup.
2022-08-17 11:57:33 +00:00
Lukáš Tyrychtr
8cd39513be Fix a typo 2022-06-19 23:25:30 +00:00
Lukáš Tyrychtr
ca04a2b550 Add a few missing labels in the wacom settings 2022-06-19 23:25:30 +00:00
Felipe Borges
e8a046765f wacom: Fix typo in UI file property name
Fixes #1777
2022-04-24 12:04:38 +00:00
Felipe Borges
c2f89ef7ba wacom: Mark two more strings as translatable
See c5d0437c0f (note_1433556)
2022-04-20 18:09:21 +02:00
oscfdezdz
c5d0437c0f wacom: mark some strings as translatable
Some UI strings were not marked as translatable when the panel was ported to GTK4.
2022-04-19 16:46:59 +00:00
Carlos Garnacho
0d82613258 wacom: Bring back empty state view
This went mistakenly missing in the recent UI updates. Since this
panel is still accessible through search despite tablet availability,
we should have a proper empty state view when moving to the panel
with no tablets available.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1684
2022-03-04 15:19:21 +00:00
Carlos Garnacho
7371dbb35c wacom: Explicitly discard input from touchscreens
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1612
2022-02-12 16:03:37 +00:00
Carlos Garnacho
57e5144f41 wacom: Avoid reset on spurious size changes
This is a possible reason for undesired calibration resets.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1613
2022-02-12 16:03:37 +00:00
Carlos Garnacho
3f12a7d2cb wacom: Allow NULL monitors in calibration
Unfortunately, this may be the case, it is better to show wonky UI
than no UI at all.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
6c6499e23e wacom: Pass GdkMonitor directly to calibrator object
Instead of figuring out a monitor number from a GdkMonitor, and
look the GdkMonitor back up, pass the GdkMonitor directly.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
6756710996 wacom: Make calibrator retrieve dimensions from window
So we can fullscreen on a monitor and forget.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
ec5ad4d3e4 wacom: Turn CcCalibArea into a window subclass
Modernize a bit the code, since it will be easier to do some things
as a window subclass.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
fce8b631cc wacom: Rename calibrator API
Add "Cc" prefix so it's more consistent with the rest of the project.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
1777a42aef wacom: Update/unbreak calibrator
It got to a building state in the GTK4 port, but was broken at
runtime. Update event handlers and builder objects so it works again.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
e26ea4e6d1 wacom: Drop dead code
These dimensions are no longer used.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
3d4d785588 wacom: Drop unused API
This function was only used for logging purposes, we can do
without it.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
a9127145d3 wacom: Move tablet/stylus sections to AdwPreferencesGroup
There is now the header-suffix property that makes it possible to add
tablet/stylus icons besides the title/description, so we can simply
use this widget.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
653d66b7a7 wacom: Add description subtitles to tablet devices 2022-02-01 14:18:53 +00:00
Carlos Garnacho
04bb70a5b3 wacom: Add description subtitles to styli 2022-02-01 14:18:53 +00:00
Carlos Garnacho
9bd0b94527 wacom: Use right function to find whether stylus has eraser tip
We are looking for paired styli that act as standalone erasers, this is
not what we are looking for here.
2022-02-01 14:18:53 +00:00