summaryrefslogtreecommitdiff
path: root/panels/wacom
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2017-10-10 07:56:17 -0700
committerCarlos Garnacho <carlosg@gnome.org>2018-01-30 21:23:24 +0100
commitf57a19256482aff44684b17ce4f07972afec1aad (patch)
tree386d50c698c9d4436d5d46427e1cb32ad7cde4d2 /panels/wacom
parent039f30a5355b088e00c6f5e509ebf79273a2c40d (diff)
downloadgnome-control-center-f57a19256482aff44684b17ce4f07972afec1aad.tar.gz
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
Diffstat (limited to 'panels/wacom')
-rw-r--r--panels/wacom/cc-wacom-stylus-page.c7
-rw-r--r--panels/wacom/cc-wacom-tool.c6
2 files changed, 13 insertions, 0 deletions
diff --git a/panels/wacom/cc-wacom-stylus-page.c b/panels/wacom/cc-wacom-stylus-page.c
index 8adc7bca7..56aeeef3a 100644
--- a/panels/wacom/cc-wacom-stylus-page.c
+++ b/panels/wacom/cc-wacom-stylus-page.c
@@ -345,6 +345,7 @@ enum {
LAYOUT_INKING, /* tip */
LAYOUT_AIRBRUSH, /* eraser, 1 button, tip */
LAYOUT_GENERIC_2_BUTTONS_NO_ERASER, /* 2 buttons, tip, no eraser */
+ LAYOUT_3DPEN, /* 3 buttons, tip, no eraser */
LAYOUT_OTHER
};
@@ -412,6 +413,10 @@ update_stylus_ui (CcWacomStylusPage *page,
remove_buttons (page->priv, 2);
remove_eraser (page->priv);
break;
+ case LAYOUT_3DPEN:
+ remove_buttons (page->priv, 3);
+ remove_eraser (page->priv);
+ break;
case LAYOUT_OTHER:
/* We already warn about it in cc_wacom_stylus_page_new () */
break;
@@ -453,6 +458,8 @@ cc_wacom_stylus_page_new (CcWacomTool *stylus)
layout = LAYOUT_AIRBRUSH;
else if (num_buttons == 2 && !has_eraser)
layout = LAYOUT_GENERIC_2_BUTTONS_NO_ERASER;
+ else if (num_buttons == 3 && !has_eraser)
+ layout = LAYOUT_3DPEN;
else {
layout = LAYOUT_OTHER;
remove_buttons (priv, num_buttons);
diff --git a/panels/wacom/cc-wacom-tool.c b/panels/wacom/cc-wacom-tool.c
index 7c74e93e5..fa1169fbd 100644
--- a/panels/wacom/cc-wacom-tool.c
+++ b/panels/wacom/cc-wacom-tool.c
@@ -18,6 +18,8 @@
*
*/
+#include "config.h"
+
#include "cc-wacom-tool.h"
enum {
@@ -252,6 +254,10 @@ get_icon_name_from_type (const WacomStylus *wstylus)
return "wacom-stylus-art-pen";
case WSTYLUS_CLASSIC:
return "wacom-stylus-classic";
+#ifdef HAVE_WACOM_3D_STYLUS
+ case WSTYLUS_3D:
+ return "wacom-stylus-3btn-no-eraser";
+#endif
default:
if (!libwacom_stylus_has_eraser (wstylus)) {
if (libwacom_stylus_get_num_buttons (wstylus) >= 3)