Commit graph

104 commits

Author SHA1 Message Date
Carlos Garnacho
2503832046 wacom: Use GdkSeat API to list slave stylus devices
Replaces usage of deprecated API.
2018-05-26 10:09:28 +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
Carlos Garnacho
7dfb7d2e5e wacom: Use updated ui files 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
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
adb82f0d00 wacom: Drop usage of last-calibration-resolution
This is gone from the g-s-d schema, so just stop setting it.

https://bugzilla.gnome.org/show_bug.cgi?id=748660
2015-04-29 19:35:34 +02:00
Carlos Garnacho
6365dafd92 wacom: Sync gsd-wacom-device.[ch] with g-s-d
And use the GdkDevice getter where it applies.
2015-04-13 14:38:24 +02:00
Benjamin Tissoires
66cb45bdad wacom: do not bail out if the tablet doesn't have an eraser
Tablets have not always an eraser (most of the generic tablets like Huion,
UC-Logic, etc... don't). We should not reject such tablets.

Commit 54849a9 (wacom: Only the stylus and eraser tools need to exist)
mentioned that we were not sure about eraser, and I think we should not
assume one either.

To do so, we simply ignore the eraser xinput node and rely on
libwacom to actually provide the eraser information.

If the stylus does not have the eraser tip, we may fall in the
LAYOUT_OTHER case. We have a picture of a generic Wacom pen with an
eraser, and the leaders linking the widget to the picture are scrambled.

To prevent that, gray out the eraser pressure slider so that we do not
break the layout.

https://bugzilla.gnome.org/show_bug.cgi?id=746117
2015-04-01 11:15:29 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Yosef Or Boczko
ae36409c5f wacom: Use margin-start/end instead of margin-left/right
https://bugzilla.gnome.org/show_bug.cgi?id=712661
2013-11-19 22:34:39 +02:00
Bastien Nocera
297eb6cfbb wacom: Fix use after free
Causing random values in the calibration data.
2013-10-08 18:59:22 +02:00
Bastien Nocera
6aa409ffdb wacom: Reset the calibration before starting a new one
We shouldn't be using the old calibration values to create the
new ones, so reset the "area" settings before starting a new
calibration, and re-apply the saved calibration if the calibration
is cancelled or fails.

https://bugzilla.gnome.org/show_bug.cgi?id=707784
2013-10-08 18:02:43 +02:00
Bastien Nocera
387e3f98f7 wacom: Print debug when calibration is finished 2013-10-04 11:16:45 +02:00
Joaquim Rocha
d83e0ff5c1 wacom: Call the OSD window for assigning the tablets' buttons
It falls back to the listbox view in case the OSD cannot be shown.

https://bugzilla.gnome.org/show_bug.cgi?id=704798
2013-07-26 20:04:35 +02:00
Joaquim Rocha
df161dba18 wacom: Use a GtkListBox for the buttons' mapping instead of a GtkTreeView
https://bugzilla.gnome.org/show_bug.cgi?id=703148
2013-07-24 11:18:24 +02:00
Yosef Or Boczko
cf81bc227f wacom: drop GtkStock
https://bugzilla.gnome.org/show_bug.cgi?id=704178
2013-07-19 15:59:26 +03:00
Joaquim Rocha
35e3697b1d wacom: Expand columns in buttons' assignment treeview
Because the GtkCellRendererAccel can't almost be seen.

https://bugzilla.gnome.org/show_bug.cgi?id=703043
2013-07-17 15:51:47 +02:00
Przemo Firszt
3708eab09d wacom: Show hard-coded action names on OLED too
Show hard-coded action names on OLED as well, not just
for custom actions.

https://bugzilla.gnome.org/show_bug.cgi?id=700498
2013-07-15 18:39:02 +02:00
Joaquim Rocha
48164b5a3f wacom: Fix segfault when trying to check if the tablet has a monitor
The check method had been changed in order to use the CcWacomPage
instead of its private struct but one of the calls to it wasn't updated.
2013-06-06 15:32:41 +02:00
Joaquim Rocha
ed3c9badff wacom: Add cc_wacom_page_calibrate and cc_wacom_page_can_calibrate functions
https://bugzilla.gnome.org/show_bug.cgi?id=692816
2013-06-05 18:29:40 +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
3cf0addbfe wacom: Do not unref variant consumed by GSettings
This avoids a critical warning.

https://bugzilla.gnome.org/show_bug.cgi?id=700511
2013-05-17 16:18:43 +02:00
Przemo Firszt
16c0a66acf wacom: Add basic OLED handling for Intuos4
This sets the OLED to the keyboard shortcut when a
custom keyboard shortcut is used.

https://bugzilla.gnome.org/show_bug.cgi?id=671072
2013-05-17 09:38:30 +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
c74a65acb5 wacom: Prevent failure when device's area cannot be retrieved
It also uses fake data from the screen's area. This functionality is
dictated by the definition of FAKE_AREA in CPPFLAGS.

https://bugzilla.gnome.org/show_bug.cgi?id=689686
2013-04-16 14:44:08 +02:00
Joaquim Rocha
9031c41784 wacom: add a link to the mouse settings panel
Based on previous work by Olivier Fourdan.
2013-04-16 12:33:16 +02:00
Olivier Fourdan
1f42956437 wacom: small code clean-up
we already set a local variable so better use it, it helps with
code readability.

https://bugzilla.gnome.org/show_bug.cgi?id=689684
2013-01-17 11:06:02 +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
Bastien Nocera
8a0f14b969 wacom: Remove extraneous semi-colon 2012-12-20 16:22:01 +01:00
Bastien Nocera
7d147e06a6 wacom: Clean up action type sanity check 2012-12-20 12:07:00 +01:00
Olivier Fourdan
f5e8101dbd wacom: check for the action type value
Action type comes from GSettings and may have been changed
to some invalid value, causing a segmentation fault in
control-center if the value is larger than the known action
types. This can also occur when downgrading from a version
with more possible actions.

Adds a sanity check to verify the given action type value
is within the bounds of the known action types.

https://bugzilla.gnome.org/show_bug.cgi?id=689265
2012-12-20 11:47:47 +01:00
Bastien Nocera
3ecbd9b3e1 wacom: Better strings for the touchring/touchstrips
Use ↺ and ↻ for the touchring buttons, and add context to the
touchstrip labels.
2012-12-20 11:29:33 +01:00
Olivier Fourdan
45d1ca8439 wacom: Use CW and CCW for ring circular motion
Using "up" and "down" on a ring is ambiguous, better
use "CW" or "CCW" to indicate the circular motion on
touch rings.

https://bugzilla.gnome.org/show_bug.cgi?id=689264
2012-12-20 10:38:59 +01:00
Olivier Fourdan
bae5488909 wacom: Add show help window to the list of actions
for pad buttons, once the OSD window patch is
merged in gnome-settings-daemon.

https://bugzilla.gnome.org/show_bug.cgi?id=683567
2012-12-20 10:38:59 +01:00
Jiro Matsuzawa
ce53dc7fd9 wacom: add translation context for Wacom action type
https://bugzilla.gnome.org/show_bug.cgi?id=682876
2012-08-28 16:51:46 +01:00
Olivier Fourdan
a2e515ea39 wacom: add different action types to mapping dialog
https://bugzilla.gnome.org/show_bug.cgi?id=679067
2012-08-21 18:00:22 +02: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
f004ecb17d wacom: Fix critical warning after calibration
g_variant_new_array() creates a floating reference and
g_settings_set_value() consumes it, so don't unref the GVariant
ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=680171
2012-07-19 16:37:02 +01:00
Olivier Fourdan
3083fda606 wacom: Destroy display mapping dialogue on unplug
https://bugzilla.gnome.org/show_bug.cgi?id=679159
2012-07-04 14:48:54 +02:00
Olivier Fourdan
1612735104 wacom: apply display rotation to device
When an output is mapped to a device, match the device rotation
with the output (bug #676170)
2012-07-03 11:50:36 +02:00
Bastien Nocera
5a2b411255 wacom: Fix crasher using link to display panel
->panel was never set within the page object.
2012-05-25 12:16:24 +01:00
Bastien Nocera
aa161bacc9 wacom: Destroy button mapping dialogue on unplug
https://bugzilla.gnome.org/show_bug.cgi?id=676790
2012-05-25 11:19:37 +01:00
Peter Hutterer
17c2e2c257 wacom: Make "Calibrate" button insensitive if there is no screen match
If no match is found for the screen tablet, calibration will fail anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=673892
2012-05-18 10:35:45 +01:00
Peter Hutterer
ff31b771bb wacom: update the UI if a new tool comes in
The device_added_cb is called once for each tool added. The wacom driver
hotplugs tools in the order stylus, eraser, cursor, pad.

update_current_page will add a new page once a tablet has stylus and
eraser, before cursor and pad exist. priv->pad is thus always NULL,
causing, cc_wacom_page's update_tablet_ui to remove the "Map Buttons..."
button for any device.

Change the code to update the tool list for every new tool we get,
merely triggering the visibility of the button instead of destroying it
completely.

https://bugzilla.gnome.org/show_bug.cgi?id=672691
2012-04-12 14:43:34 +01:00