Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-25 12:42:46 +0300
committerCampbell Barton <campbell@blender.org>2022-10-25 12:42:46 +0300
commitc4f9e4afab8c51e271fc6a313ccd2dd0b8d3186c (patch)
treec90045991427e641d2d17e1ab7094871dad70528 /intern/ghost
parent7e3e4751b544bce290288de4af8651847d230655 (diff)
GHOST/Wayland: swap tablet middle/right mouse buttons
There looks to be an inconsistency between Gnome/KDE here, match KDE and Gnome applications under X11 (even XWayland) by making the button closest to the nib MMB, and the other button RMB.
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 60247660a9c..f09678374fa 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -174,9 +174,14 @@ static bool use_gnome_confine_hack = false;
/**
* Tablet events.
+ *
+ * \note Gnome/GTK swap middle/right, where the same application in X11 will swap the middle/right
+ * mouse button when running under WAYLAND. KDE doesn't do this, and according to artists
+ * at the Blender studio, having the button closest to the nib be MMB is preferable,
+ * so use this as a default. If needs be - swapping these could be a preference.
*/
-#define BTN_STYLUS 0x14b /* Use as right-mouse. */
-#define BTN_STYLUS2 0x14c /* Use as middle-mouse. */
+#define BTN_STYLUS 0x14b /* Use as middle-mouse. */
+#define BTN_STYLUS2 0x14c /* Use as right-mouse. */
/* NOTE(@campbellbarton): Map to an additional button (not sure which hardware uses this). */
#define BTN_STYLUS3 0x149
@@ -2969,10 +2974,10 @@ static void tablet_tool_handle_button(void *data,
GHOST_TButton ebutton = GHOST_kButtonMaskLeft;
switch (button) {
case BTN_STYLUS:
- ebutton = GHOST_kButtonMaskRight;
+ ebutton = GHOST_kButtonMaskMiddle;
break;
case BTN_STYLUS2:
- ebutton = GHOST_kButtonMaskMiddle;
+ ebutton = GHOST_kButtonMaskRight;
break;
case BTN_STYLUS3:
ebutton = GHOST_kButtonMaskButton4;