Commit graph

394 commits

Author SHA1 Message Date
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Jason Gerecke
f57a192564 wacom: Support the WSTYLUS_3D stylus type
Wacom's new "Pro Pen 3D" stylus is declared as a new stylus type within
libwacom: WSTYLUS_3D. Now that the Wacom panel supports arbitrary three-
button styli, we can add specific support for this new stylus type to
suppress the warning message that is generated.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Jason Gerecke
039f30a535 wacom: Add support for three-button styli
Wacom has introduced its new "Pro Pen 3D" stylus which includes a third
button. This commit adds support for arbitrary three-button styli.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Jason Gerecke
69e94483b7 wacom: Make remove_buttons dynamic
Both 'remove_buttons' and 'remove_button' perform the same general task and
can be unified into a single function. This makes supporting an arbitrary
number of stylus buttons more straightforward.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Jason Gerecke
0c65e04b2e wacom: Set combo-topbutton to current value for styli with > 2 buttons
Although the Wacom panel doesn't have explicit support for styli with more
than two buttons, it tries to at least allow configuration of the upper and
lower buttons. This commit fixes an incorrect conditional which prevents
the panel from setting the combo box for the upper switch to the current
setting.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
2018-01-30 21:23:24 +01:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01: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
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02: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
978ccdc9af wacom: Correct order of area calibration values
Commit cf408c27b0 changed how the values stored in the "area" key were
calculated in order be compatible with its updated schema. Unfortunately,
it overlooked the fact that updated schema also changed the order of the
values from "left, top, right, bottom" to "left, right, top, bottom".
Because of this, corrections intended to be applied to the top and right
screen edges were swapped. This can cause a noticible cursor offset to
occur after finishing calibration.

https://bugzilla.gnome.org/show_bug.cgi?id=784009
2017-07-05 23:46:22 +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
42489e2509 wacom: Map the GsdDevice to a GdkDevice when spawning the calibrator
This makes the calibrator only reactive to the tablet being calibrated
again.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 21:11:54 +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
60ad6a35b4 wacom: Fix compile-time warning
expected ‘GtkWidget * {aka struct _GtkWidget *}’ but argument is of type ‘CcWacomNavButton * {aka struct _CcWacomNavButton *}’
2017-06-07 18:17:33 +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
Alberts Muktupāvels
2536a6cfa2 wacom: fix build error
/usr/bin/ld: /mnt/wd20ezrx-00dc0b0/JHBuild/3.24/install/lib/libgnome-desktop-3.so: undefined reference to symbol 'XFree'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libX11.so: error adding symbols: DSO missing from command line

Change linking order to fix build.
2016-11-09 15:16:34 +02:00
Carlos Garnacho
2c00289f5f wacom: Remove g-s-d code synchronization rule
This code is going from g-s-d, the remaining bits should be adopted
by g-c-c.
2016-11-04 23:27:13 +01:00
Carlos Garnacho
1e31494f22 wacom: Remove GsdWacomDevice
It is now entirely unused.
2016-11-04 23:27:13 +01:00
Carlos Garnacho
0d402c8338 wacom: Update test to use CcWacomDevice
So it works again.
2016-11-04 23:27:13 +01:00
Carlos Garnacho
4babfe2e9f wacom: Add constructor for fake CcWacomDevice objects
So it can be used in test-wacom
2016-11-04 23:27:13 +01:00
Carlos Garnacho
7dfb7d2e5e wacom: Use updated ui files 2016-11-04 23:27:12 +01:00
Carlos Garnacho
b770d37457 wacom: Refurbish UI files
Some improvements to fit better with the new design:
- "no configured ..." page for both stylus/tablet sections
- the navigation buttons are now children of GtkRevealers, so
  size doesn't popup
- Empty placeholder in several containers have been removed.
2016-11-04 23:27:12 +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
Carlos Garnacho
dbff3d9284 wacom: Remove unused struct definition
It seems this was never used.
2016-11-04 23:26:42 +01:00
Carlos Garnacho
b5de120e3f wacom: Poke the org.gnome.Shell D-Bus call to show the pad OSD
This feature now belongs in gnome-shell, not g-s-d. The D-Bus API
changed correspondingly.
2016-11-04 23:26:42 +01:00
Carlos Garnacho
143b7ac849 wacom: Populate button mapping dialog
We now use the CcWacomDevice API for this.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
5fdf5ad8ec wacom: Add cc_wacom_device_get_button_settings()
This function retrieves the GSettings pointing to the configuration
of the given button, or NULL if not found.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
8122e43b31 wacom: Add cc_wacom_tool_get_num_buttons()
Uses libwacom underneath.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
d118070a73 wacom: Clean up CcWacomButtonRow
We now only care of pad buttons, so this code can be quite simplified.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
f06203a5b2 wacom: Update .ui files to look more like the mockups 2016-11-04 23:26:41 +01:00
Carlos Garnacho
2f4f3f994c wacom: Update .ui file to reflect GDesktopStylusButtonAction
The set of actions that can be mapped to an stylus button have been
reduced, due to inconsistent semantics in wayland.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
4743770832 wacom: Update to the new data model
There's much going on under the hood here:
- Styli and tablets are now in split views, as per the mockups.
- CcWacomDevice and CcWacomTool are now in use, with the subsequent
  API use changes. Moreover, using these objects means using the
  newer schemas in gsettings-desktop-schemas, so there had to be
  changes in the settings we store too.
- We now use CcTabletToolMap, plus listen to tool proximity events,
  populating the "Stylus" sub-pane with those.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
26ce8c4b2e wacom: Add display mapping API to CcWacomDevice
This can only be used for tablets that are not display nor system
integrated (eg. intuos models). The mapping of tablets with a builtin
display remain in g-s-d/GsdDeviceMapper.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
fe5c5f97c8 wacom: Add CcTabletToolMap
In the wayland tablet input model, compositor and clients may
recognize the different physical styli in use, even if those are
used across compatible tablets.

This object is intended to be used as a persistent memory of
which stylus was used with which tablet. So you 1) can associate
tools and devices when such combination happens, and 2) query the
styli that were previously used with a tablet when it is detected/
plugged.

These associations are stored in two keyfiles in
~/.cache/gnome-control-center/wacom/, one for tablets and other
for styli.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
0a6219886b wacom: Add CcWacomTool
Similar to CcWacomDevice vs GsdWacomDevice, CcWacomTool is meant to
replace the GsdWacomStylus object. There is a substantial difference
between these two objects, CcWacomTool offers constructor methods,
it expects the caller to maintain lifetime otherwise. while
GsdWacomStylus objects creation was rather fixed (GsdWacomDevice
created all possible styli on initialization). This latter model
doesn't help us use all the possibilities wrt wayland configurability.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
2b75f5dfcc wacom: Add CcWacomDevice
This is a vast oversimplification of GsdWacomDevice. This one
has code that is largely unnecessary here (mostly devised for g-s-d),
plus it will be even eventually removed from g-s-d (the functionality
is moving into compositor domain), so the code sharing argument
remains pretty weak.

So, CcWacomDevice is thought to take over, just offering the basic
API we after all need in the gnome-control-center side.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
b69cbe4e24 wacom: Add "Test your settings" button to wacom panel
A popover with a CcDrawingArea appears in that case.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
472d87844e wacom: Add CcDrawingArea
This is a testing drawing widget that can be used to the a feeling
of changes to stylus settings.
2016-11-04 23:26:41 +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
Georges Basile Stavracas Neto
2777fd583d panels: use the new categories
Following the previous patch, this patch adds the new alternative
categories to the panels' Desktop files. These alternative categories
are only relevant for the alternative Shell, and do not break the
current Shell in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00
Bastien Nocera
5c10ce45b8 panels: Fix translators comments being truncated
Commit b3be076 added soft hyphens along with a comment for translators
to use those soft hyphens. Except that gettext would only grab the one
line out of the four we wrote for translators to read. Put them all on
the same line so that gettext actually extracts those.

https://bugzilla.gnome.org/show_bug.cgi?id=765778
2016-04-28 23:38:00 +02:00
Bastien Nocera
b3be07609a panels: Fix truncated panel names for larger fonts
Note that this fix will not automatically fix translations, which will
need to add soft-hyphens (U+00AD) to their translations themselves, and
will not fix larger fonts for which the split up syllables end up
being bigger than the maximum text width.

It's the best we can do without redesigning the Settings shell, which is
already something planned.

https://bugzilla.gnome.org/show_bug.cgi?id=647087#c13
2016-04-07 16:06:35 +02:00
Bastien Nocera
97c2a880c8 wacom: Update from gnome-settings-daemon 2016-03-24 17:01:37 +01:00
Bastien Nocera
d6765b0378 wacom: Use the fully qualified D-Bus name for the OSD
So that we don't end up seeing the fallback button mapping dialogue when
running gsd-test-wacom.
2016-03-10 17:19:30 +01:00
Debarshi Ray
84b65ddea0 wacom: Use the right API for setting the window width
We should be pairing gtk_window_get_size with
gtk_window_set_default_size to avoid inconsistencies between the size
reading and setting code. eg., in recent GTK+ versions,
gtk_window_get_size and gtk_widget_set_size_request differ in their
interpretation of the CSD chrome.

However, gtk_window_set_default_size didn't work with non-resizable
GtkWindows, until now.

https://bugzilla.gnome.org/show_bug.cgi?id=762548
2016-03-09 13:47:09 +01: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
Rui Matos
888e40eae8 wacom: Avoid crashing when opening the panel on wayland sessions
We don't yet support wacom devices under wayland and GsdWacomDevice
uses X APIs unconditionally which makes us crash under wayland.

Instead, let's return early and leave the GsdWacomDevice in an invalid
state which means that we just present the default UI for "no wacom
devices detected".
2016-01-18 14:53:28 +01:00