Commit graph

91 commits

Author SHA1 Message Date
Carlos Garnacho
8f825c5cc0 wacom: Dispose custom style provider with calibrator
Each CalibArea created adds a style provider that is never removed,
remove it on calib_area_free() to avoid the leak.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/504
2019-05-01 16:10:06 +02:00
Carlos Garnacho
dbd78496e1 wacom: Ensure calibrator UI CSS only applies to its UI
Set a name on the fullscreen window, and require it in all selectors
in the custom CSS. Fixes style leaking to other g-c-c bits.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/504
2019-05-01 16:09:58 +02:00
Carlos Garnacho
d51336c2c2 wacom: Port calibrator UI to GTK+
Same dog, different collar. The UI has been ported 1:1 to GTK+, using
GtkBuilder, CSS and event controllers fairly reduced the amount of code
needed for this.

It also allows us to stop initializing clutter-gtk across the several
executables.
2018-11-07 23:02:10 +00:00
Robert Ancell
aeca65c729 wacom: Replace GObject boilerplate with G_DECLARE_TYPE 2018-08-02 21:48:02 +00:00
Carlos Garnacho
35adc02d42 wacom: Use GdkMonitor API on calibrator UI
Replaces usage of deprecated GdkScreen API. We still have to pass
monitor numbers around for gdk_window_fullscreen_on_monitor(), such
is life.
2018-05-26 10:09:28 +02:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Jason Gerecke
50b39dc570 wacom: Drop old_axes from calibration API
The calibration utility was modified in cf408c27b0 to return unitless
padding measurements instead of axis values for storage in gsettings.
Unfortunately, the code still assumes in some places that it is working
with axes rather than paddings. This causes subtle math errors that
result in undesired cursor offsets after the calibration is applied.

Fortunately, this can be simplified, since tablet area is always reset
to the default state before starting calibration, we are sure that the
value will remain constant. Since both axes are in the same 0..1 scale,
calibration code doesn't need to swap X/Y back and forth to calculate
each axis scale.

Additionally, the code to get the calibrated axis values has been moved
into its own function along with a new function that returns padding
values suitable for consumption by g-c-c. All calculations are performed
internally in the 0..1 range.

https://bugzilla.gnome.org/show_bug.cgi?id=784009

Co-Authored-By: Carlos Garnacho <carlosg@gnome.org>
2017-07-05 23:46:22 +02:00
Carlos Garnacho
b26d6acb5f wacom: Make calibrator use GDK for button events
This way we can cut down the last step in the mapping across
GUdevDevice->GsdDevice->GdkDevice->ClutterInputDevice.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 21:11:54 +02:00
Bastien Nocera
3f0510cac8 build: Better libm checks
Use AC_CHECK_LIBM instead of AC_CHECK_LIB(m,...
and use $(LIBM) instead of hardcoding "-lm" in Makefiles.
2017-02-08 19:21:53 +01:00
Bastien Nocera
aaf037d9a7 wacom: Fix format errors
format ‘%d’ expects argument of type ‘int’, but argument 2 has type
‘gdouble {aka const double}’
2016-11-16 17:03:49 +01:00
Carlos Garnacho
cf408c27b0 wacom: Instaurate calibration
The "area" setting has a different treatment in the gsettings-desktop-schemas
tablet schema, the 4 double values express the padding (in unitless 0..1
range) on each of the sides of the tablet. It's been done so we don't rely
on input/output units, which we might have not the luxury to access.

Besides that, the dependency on GsdWacomDevice has been cleared.
2016-11-04 23:26:42 +01:00
Piotr Drąg
bd0d048944 wacom: use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2016-10-03 15:21:28 +02:00
Carlos Garnacho
ff2cfece51 wacom: Avoid deprecated Clutter API 2016-01-22 21:57:49 +01:00
Carlos Garnacho
c0e854a6dd wacom: Workaround deadlocks in Clutter event handlers
The way we destroy the window during the handling of a clutter event may
cause the window to generate a focus event that gets processed immediately,
causing Clutter to deadlock on its global lock.

Bypass these issues in the places where we finalize out of Clutter events,
The Esc key presses are now handled at the GTK+ level, and we postpone
finalization (with either success or failure) to an idle.

Works around https://bugzilla.gnome.org/show_bug.cgi?id=747880
2016-01-22 21:51:46 +01:00
Carlos Garnacho
65bd735937 wacom: Refactor calibrator finalization into separate function
Instead of calling the delete event handler everywhere.
2016-01-22 21:50:38 +01:00
Jason Gerecke
ae11d34c60 wacom: Fix window decorations being visible in calibrator window
The 'on_fullscreen' function which handles the 'window-state-event'
signal should be returning a gboolean value. Fix the function
signature and have it return FALSE to allow the event to continue to
propagate.

https://bugzilla.gnome.org/show_bug.cgi?id=751129
2015-07-01 11:42:45 +02:00
Rui Matos
205a0cd4bd wacom: Drop deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
2014-12-05 16:13:29 +01:00
Carlos Garnacho
b1ae5c734a wacom: Fix x/y ranges' swapping when calibrating on rotated screens
The previous axis swapping code would oddly rely on the input coordinates
remaining on untransformed device coordinates, while those are gotten on
screen coordinates (hence rotated), this would cause swapping not to kick
in, and result in swapped X/Y scaling to be applied to X/Y ranges.

So make the axis swapping code be calculated upon screen coordinates, as
the collected points already are, and swap the applied scalings if
necessary.

Also, the code that swapped coordinates before returning to the caller
would scramble min/max values when swapping x/y. Fix that too, minimum
and maximum should stay like that when swapping axes.

https://bugzilla.gnome.org/show_bug.cgi?id=732442
2014-07-01 18:38:22 +02:00
Carlos Garnacho
4a9bde0679 calibrator: Use G_STMT_START/END on SWAP define
And let it pass the type, so it can be used on other than integers.

https://bugzilla.gnome.org/show_bug.cgi?id=732442
2014-07-01 18:38:22 +02:00
Christophe Fergeau
2096cacaf5 wacom: Use AM_CPPFLAGS rather than INCLUDES
This is deprecated in newer automake versions, and this causes warnings
with automake 1.14:
panels/printers/Makefile.am:3: warning: 'INCLUDES' is the old name for
AM_CPPFLAGS' (or '*_CPPFLAGS')

https://bugzilla.gnome.org/show_bug.cgi?id=732189
2014-06-25 12:46:43 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Carlos Garnacho
c78e22b911 wacom: Fix first animation of calibration UI
The "target" was seen moving from 0,0 to the first calibration
point, so 1) avoid target relayouts when the window is still
being positioned and 2) start the "target" actor as hidden so
it isn't seen moving from anywhere when first shown.

https://bugzilla.gnome.org/show_bug.cgi?id=719698
2013-12-16 12:58:35 +01:00
Carlos Garnacho
ee2afb9bd4 wacom: Protect calibrator UI to spawn animations multiple times
The window state may be updated more than once, so only initiate
the UI and animations when it's first called.

https://bugzilla.gnome.org/show_bug.cgi?id=719698
2013-12-16 12:58:29 +01:00
Carlos Garnacho
911518d683 wacom: Don't leave stray timelines on the calibration UI
Keep the reference for the error/helper messages animations in
the CalibArea struct, so those are destroyed and not leaked, or
possibly crashing when running on already destroyed actors if
the dialog gets cancelled at the right time.

https://bugzilla.gnome.org/show_bug.cgi?id=719698
2013-12-16 12:58:07 +01:00
Carlos Garnacho
e97143e025 wacom: Forgive inconspicuous double clicks when calibrating
Those were likely not meant, and will surely make you start over
again on the calibration process.

https://bugzilla.gnome.org/show_bug.cgi?id=719705
2013-12-16 12:44:42 +01:00
Carlos Garnacho
e2464ee773 wacom: Don't use monitor geometry X/Y when calculating calibration
Calibration must be performed based on the device w/h ranges and the
screen size, so in which coordinates the monitor is virtually mapped
matters little on device coordinates. This fixes calibration of devices
attached to a monitor elsewhere than (0,0) in the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=719574
2013-12-16 12:42:01 +01:00
Carlos Garnacho
71945b8156 wacom: Clear background on "target" actor in calibration UI
the actor's draw() method isn't guaranteed to get a pristine surface,
which may cause artifacts if the background is left untouched, so
clear the background each time the actor has to be drawn.

https://bugzilla.gnome.org/show_bug.cgi?id=719701
2013-12-16 12:30:24 +01:00
Bastien Nocera
95f613bee1 wacom: Fix ~100 pixel offset when calibrating
The calibration gui code moved the targets to x,y, instead of
placing the centre of the target at x,y, leading to a 47 pixel
(half the target's size) offset in both directions (thus 67 pixels
deviation as Pythagorus would tell us).
2013-10-09 12:55:29 +02:00
Bastien Nocera
bf68dfb62d wacom: Fix comment for timeout duration
The comment mentioned 5 seconds, but we use 15 seconds.
2013-10-09 12:18:48 +02:00
Bastien Nocera
18dd6ff04f wacom: Fix incorrect default window information
The window isn't 1x1...
2013-10-08 20:15:55 +02:00
Bastien Nocera
c9864b1ebc wacom: Fix event filtering in the calibrator
We were always getting the events from the core pointer instead
of the device itself, so threw all of them away.
We need to get the real source device from the event.

https://bugzilla.gnome.org/show_bug.cgi?id=707784
2013-10-08 11:48:13 +02:00
Bastien Nocera
054538c292 wacom: Add some more debug to the calibrator tool 2013-10-04 11:16:45 +02:00
Bastien Nocera
55744f6544 wacom: Fix device filtering in calibration UI
We receive ClutterEvents, not GdkEvents for button presses on
ClutterActors, so use the correct functions to filter devices.

This also fixes the offset used to access the coordinates of the
events. We were actually using the pointer to the source and x
struct members instead of x and y.

https://bugzilla.gnome.org/show_bug.cgi?id=707784
2013-10-04 11:16:45 +02:00
Joaquim Rocha
d78bc9772a wacom: Re-write gui_gtk in Clutter to introduce animations
The name of the file was also changed to calibratorgui.c/h to avoid
it being inconsistent, this way it is no longer dependent on the
the technology.

https://bugzilla.gnome.org/show_bug.cgi?id=667797
2013-05-17 16:36:59 +02:00
Joaquim Rocha
2b34736ea8 wacom: Set the last-calibrated-resolution key after calibrating
So g-s-d will know if calibration is needed when the monitor resolution
changes.

This is related to https://bugzilla.gnome.org/show_bug.cgi?id=677095
2013-05-16 11:26:29 +02:00
Joaquim Rocha
3702a56793 wacom: Show the cursor in the calibrator UI when used from test_wacom
This functionality is dictated by the definition of FAKE_AREA in the
CPPFLAGS.
2013-04-16 14:44:08 +02:00
Joaquim Rocha
19876f84d9 wacom: Create a similar calibrator library for testing purposes
This is so we can e.g. add different parameters when creating it
2013-04-16 14:44:08 +02:00
Ángel Guzmán Maeso
1f57add30f wacom: Fix deprecated functions in gui_gtk.c
From gtk_icon_info_free() to g_object_unref()
gtk_window_set_opacity() to gtk_widget_set_opacity()

https://mail.gnome.org/archives/commits-list/2013-February/msg02049.html

https://bugzilla.gnome.org/show_bug.cgi?id=694362
2013-02-21 17:08:26 +01:00
Cosimo Cecchi
82f8c136c0 wacom: use a GResource for GtkBuilder UI definition and icons
https://bugzilla.gnome.org/show_bug.cgi?id=691132
2013-01-07 10:57:17 +01:00
Olivier Fourdan
06554439b7 wacom: Do calibration for the selected tool only
As different tools may have different resolutions (e.g.
touch vs. stylus on tablets which support both).

https://bugzilla.gnome.org/show_bug.cgi?id=680114
2012-07-19 16:39:36 +01:00
Olivier Fourdan
1fdfa6bc32 wacom: show calibration success
by drawing an "emblem-ok-symbolic" icon when calibration is
successful

https://bugzilla.gnome.org/show_bug.cgi?id=668610
2012-07-16 17:25:13 +01:00
Olivier Fourdan
978aa81a2c wacom: Cancel calibration if window loses focus
Make the calibrator window stay above other windows and cancel
calibration if/when the calibrator loses input focus.

https://bugzilla.gnome.org/show_bug.cgi?id=675354
2012-06-14 18:09:52 +01:00
Bastien Nocera
f1775d373d wacom: Hide cursor when calibrating
Otherwise the cursor might get in the way.

https://bugzilla.gnome.org/show_bug.cgi?id=668609
2012-01-24 20:23:31 +00:00
Jason Gerecke
bb38492e52 wacom: Have calibrator take into account window geometry
Current calculations assume the window is anchored at 0,0. This
obviously poses a problem in a multi-monitor setup.
2012-01-16 11:55:00 +00:00
Bastien Nocera
54ec95051e wacom: Update for new calibrator API 2012-01-12 18:57:45 +00:00
Bastien Nocera
705287d5c7 wacom: Fix insane Calibrator API
So that we don't have to run gtk_main() in it.
2012-01-12 18:57:20 +00:00
Bastien Nocera
a227cd7ca9 wacom: Add more padding around the clock 2012-01-12 17:38:05 +00:00
Bastien Nocera
aec7039858 wacom: Remove rectangle around main text 2012-01-12 15:04:05 +00:00
Bastien Nocera
956590dd8b wacom: Remove unused geometry struct member 2012-01-11 20:09:40 +00:00