Commit graph

47 commits

Author SHA1 Message Date
Robert Ancell
dab5f5301f wacom: Use g_auto for variables 2019-09-09 22:08:26 +00:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Carlos Garnacho
4860f3637c wacom: Update "Test your settings" button sensitivity on device availability
The button/popover are meaningless if there's no device to test with. Set
it inactive (so the popover hides if visible) and set insensitive if no
devices are found.
2019-02-12 00:40:14 +00:00
Carlos Garnacho
a4cc9d35b9 wacom: Always try to add the stylus page UI on proximity
This used to be done only if the stylus was "brand new", because pages for
previously known styli are added when the tablet is detected/plugged. There
are however situations where this may break: eg. the stylus was previously
known through a tablet that is not plugged ATM. The tool is however "not
new" so no UI is added for it.

We should try to add the stylus invariably on proximity, add_stylus_page()
ensures there is only one page per tool anyway.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/315
2019-01-05 12:36:59 +00:00
Peter Hutterer
def41bc0fe wacom: ignore the wacom driver's touch tool type
When the wacom driver handles the touch device, we get a tool id of 0x3. Let's
ignore that because we don't need a tool for the touch node.

Ideally we should be able to rely on the GDK tool type but that one is always
GDK_DEVICE_TOOL_TYPE_UNKNOWN see
https://gitlab.gnome.org/GNOME/gtk/merge_requests/453

A GTK bug (also fixed in that MR) prevents the tool id from updating.
Until that GTK bug is fixed the pen will only be detected if it is the first
event from this physical device. If the touch node sends an event before the
pen, the pen won't be detected.
2018-12-18 20:46:02 +00:00
Peter Hutterer
d925ea3c6c wacom: Map wacom-driver-specific generic IDs to 0
The xf86-input-wacom driver doesn't use 0 for tools that do not have an id or
serials. Serials default to 1, and the tool id is either 0x2 for stylus or 0xa
for eraser, see xf86WacomDefs.h, the defines for STYLUS_DEVICE_ID and
ERASER_DEVICE_ID.

libwacom uses 0xfffff and 0xffffe for the generic pens and all the lookup code
we have in the panel is designed for a serial/tool id of 0. So let's just map
the wacom driver IDs to 0 at the only transition point between Gdk and our
panel.

No devices with serials 0 or hw ids 2/10 exist, so this shouldn't have side
effects. This only affects X + xf86-input-wacom.
2018-12-18 20:46:02 +00:00
Robert Ancell
aeca65c729 wacom: Replace GObject boilerplate with G_DECLARE_TYPE 2018-08-02 21:48:02 +00:00
Bastien Nocera
0e2a4aa2d6 wacom: Hide Wacom panel when there are no tablets
Use GsdDeviceManager to monitor libwacom-supported tablets coming and
going. Hide the Wacom panel from the list when there's no supported
tablets plugged in.
2018-06-20 12:53:11 +00:00
Carlos Garnacho
7dfb7d2e5e wacom: Use updated ui files 2016-11-04 23:27:12 +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
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
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
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
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
Carlos Garnacho
fdef36294a wacom: Set several notebooks' show-border property to FALSE
Since GTK+ commit 05b1ea84b, this hint is used in GtkNotebook to add
a GTK_STYLE_CLASS_FRAME when rendering the notebook frame, so the theme
renders those frame-alike. As it's not what we want for the wacom panel,
set show-border to FALSE on all GtkNotebooks.

https://bugzilla.gnome.org/show_bug.cgi?id=710709
2013-12-02 12:29:30 +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
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
366fd4ba94 wacom: Add command line support for calibration
https://bugzilla.gnome.org/show_bug.cgi?id=692816
2013-06-05 18:29:40 +02:00
Joaquim Rocha
e45bafaacb wacom: Add command line argument support for choosing the tablet
https://bugzilla.gnome.org/show_bug.cgi?id=692816
2013-06-05 18:29:40 +02: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
Matthias Clasen
3d27d8caaf shell: Fittsify panels
Make it possible for panels to go all the way to the edge of the
shell. This is particularly important for panels that scroll, such
as the new power panel. All other panels are changed to compensate
for the loss of external padding.

https://bugzilla.gnome.org/show_bug.cgi?id=691229
2013-01-07 10:51:29 +01:00
Bastien Nocera
3686cf7eb8 shell: Make all control-center plugins static
This makes loading faster, with less I/O, avoids unnecessary
code duplication (around 1k lines shaved), and ensures that
all the panels link and work appropriately.

By the same token, it will stop external panels from being
created, and loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=690036
2012-12-11 17:07:39 +01:00
Bastien Nocera
2a88736cf6 wacom: Add link to wacom docs
And not the generic control-center docs.

https://bugzilla.gnome.org/show_bug.cgi?id=675471#c40
2012-09-12 10:24:19 +01:00
Ray Strode
b0e7a5efa8 panels: add register macro
Bastien says he doesn't like the blank class_finalize
functions in every panel and he would like a wrapper
macro to hide them.

This commit does that.
2012-08-21 14:32:33 -04: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
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
Bastien Nocera
9df8c7cf62 wacom: Add "pad" argument to cc_wacom_page_new() 2012-02-14 19:37:53 +00:00
Bastien Nocera
87005e3f75 wacom: Fix excessive top padding
https://bugzilla.gnome.org/show_bug.cgi?id=668881
2012-01-30 15:23:28 +00:00
Bastien Nocera
289d1e90c5 wacom: Implement switching to Display settings 2012-01-26 19:10:11 +00:00
Bastien Nocera
ce8186dba1 wacom: Add navigation button to navigate between styli
Looks a bit rough, but functionality is present.
2011-11-28 18:24:15 +00:00
Bastien Nocera
54849a9e97 wacom: Only the stylus and eraser tools need to exist
And then again, not even sure about the eraser. But there
are devices we support that don't need the pad tool, such as the
Thinkpad X201 tablet.
2011-11-25 17:04:05 +00:00
Bastien Nocera
87fc4c9a60 wacom: Update for CcWacomPage changes
Pages are now created dynamically, and the UI supports multiple
different types of tablets (even though GsdWacomDevice doesn't, and
we don't have any UI to switch devices).
2011-11-24 19:15:13 +00:00
Bastien Nocera
7976938fc6 wacom: Remove unused finalize function 2011-11-24 19:15:13 +00:00
Bastien Nocera
46bfcd1bc3 wacom: Split out the tablet page
So we can reuse it for separate tablet configurations.
2011-11-24 19:15:13 +00:00
Bastien Nocera
9d96073023 wacom: Minimum port to latest g-s-d code
Just so that we don't crash on startup.
2011-11-22 18:16:45 +00:00
Bastien Nocera
4ef431c34f wacom: Show "stand-by" page when Wacom not available
https://bugzilla.gnome.org/show_bug.cgi?id=657424
2011-09-20 09:53:32 +01:00
Peter Hutterer
a4c96614bf wacom: add a left-handed switch
Add a switch for left-handed orientation (read: no/180 degree
rotation). g-s-d and  the driver allow for 4 orientations, so this only
activates the switch as "on" if the rotation is "half".

https://bugzilla.gnome.org/show_bug.cgi?id=657810
2011-09-02 16:47:02 +01:00
Jakub Steiner
e3dbbef480 wacom: Improve alignment of lines and widgets
Use SVG image instead of PNG so that it will scale with the font size.

https://bugzilla.gnome.org/show_bug.cgi?id=657425
2011-09-02 15:34:54 +01:00
Bastien Nocera
05ffef7347 wacom: Fix strange bottom padding
Spotted by Matthias Clasen <mclasen@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=657426
2011-08-27 12:27:02 +01:00
Bastien Nocera
4ce3d9f9ab wacom: Add padding around the widgets 2011-08-26 11:35:27 +01:00
Bastien Nocera
dcd5ecac69 wacom: Clean up settings on destruction 2011-08-26 11:35:27 +01:00
Bastien Nocera
4808eb5ab3 wacom: Clean up panel instantiation 2011-08-26 11:35:27 +01:00
Bastien Nocera
dc5c93787b wacom: Clean up GSettings instantiation 2011-08-26 11:35:27 +01:00
Bastien Nocera
e88053c244 wacom: Simplify widgets getting 2011-08-26 11:35:27 +01:00
Bastien Nocera
ae35bd1e08 wacom: Fix memory leak 2011-08-26 11:35:27 +01:00
Peter Hutterer
7b213472f1 wacom: add a wacom control panel.
https://bugzilla.gnome.org/show_bug.cgi?id=640981
2011-08-26 11:35:27 +01:00