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:
authorrecht Van Lommel <brecht@blender.org>2022-09-26 23:56:14 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-09-26 23:59:35 +0300
commit84ddb8b3cc9989c2d5569bf2fa381a585f99d20f (patch)
treee41c117b0551d888abead3d09bacaabaab66379c /source/blender
parent57ea827bfb28eb697b74dbc606facbc133e10fab (diff)
UI: add preference to disable touchpad multitouch gestures
Available on Windows and macOS, where such gestures are supported. For Windows, disabling this option restores touchpad behavior to match Blender 3.2. Ref T97925 Differential Revision: https://developer.blender.org/D16005
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c2
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c18
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/intern/wm_files.c4
-rw-r--r--source/blender/windowmanager/intern/wm_window.c4
6 files changed, 21 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index f8fb3b47570..b4890131861 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -535,7 +535,7 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(280, 44)) {
- userdef->uiflag &= ~(USER_UIFLAG_UNUSED_0 | USER_UIFLAG_UNUSED_1);
+ userdef->uiflag &= ~(USER_NO_MULTITOUCH_GESTURES | USER_UIFLAG_UNUSED_1);
userdef->uiflag2 &= ~(USER_UIFLAG2_UNUSED_0);
userdef->gp_settings &= ~(GP_PAINT_UNUSED_0);
}
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index ed4bea97aa0..9d8b75450ca 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -1075,7 +1075,7 @@ typedef enum eWalkNavigation_Flag {
/** #UserDef.uiflag */
typedef enum eUserpref_UI_Flag {
- USER_UIFLAG_UNUSED_0 = (1 << 0), /* cleared */
+ USER_NO_MULTITOUCH_GESTURES = (1 << 0),
USER_UIFLAG_UNUSED_1 = (1 << 1), /* cleared */
USER_WHEELZOOMDIR = (1 << 2),
USER_FILTERFILEEXTS = (1 << 3),
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index b2f37ee2ae1..c9e3822c996 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -403,11 +403,11 @@ static void rna_userdef_anim_update(Main *UNUSED(bmain),
USERDEF_TAG_DIRTY;
}
-static void rna_userdef_tablet_api_update(Main *UNUSED(bmain),
- Scene *UNUSED(scene),
- PointerRNA *UNUSED(ptr))
+static void rna_userdef_input_devices(Main *UNUSED(bmain),
+ Scene *UNUSED(scene),
+ PointerRNA *UNUSED(ptr))
{
- WM_init_tablet_api();
+ WM_init_input_devices();
USERDEF_TAG_DIRTY;
}
@@ -5738,6 +5738,14 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_enum_items(prop, view_zoom_axes);
RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
+ prop = RNA_def_property(srna, "use_multitouch_gestures", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_NO_MULTITOUCH_GESTURES);
+ RNA_def_property_ui_text(
+ prop,
+ "Multitouch Gestures",
+ "Use multitouch gestures for navigation with touchpad, instead of scroll wheel emulation");
+ RNA_def_property_update(prop, 0, "rna_userdef_input_devices");
+
prop = RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
RNA_def_property_ui_text(
@@ -5873,7 +5881,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
"Tablet API",
"Select the tablet API to use for pressure sensitivity (may require "
"restarting Blender for changes to take effect)");
- RNA_def_property_update(prop, 0, "rna_userdef_tablet_api_update");
+ RNA_def_property_update(prop, 0, "rna_userdef_input_devices");
# ifdef WITH_INPUT_NDOF
/* 3D mouse settings */
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 775b62e7d39..5b6f7939ab9 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -94,7 +94,7 @@ void WM_init_state_maximized_set(void);
void WM_init_state_start_with_console_set(bool value);
void WM_init_window_focus_set(bool do_it);
void WM_init_native_pixels(bool do_it);
-void WM_init_tablet_api(void);
+void WM_init_input_devices(void);
/**
* Initialize Blender and load the startup file & preferences
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 6216cd87e70..92844dddf4c 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -462,8 +462,8 @@ static void wm_init_userdef(Main *bmain)
/* Update the temporary directory from the preferences or fallback to the system default. */
BKE_tempdir_init(U.tempdir);
- /* Update tablet API preference. */
- WM_init_tablet_api();
+ /* Update input device preference. */
+ WM_init_input_devices();
BLO_sanitize_experimental_features_userpref_blend(&U);
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 85e1227ab73..89bf2b82426 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -2006,12 +2006,14 @@ void WM_init_native_pixels(bool do_it)
/** \name Cursor API
* \{ */
-void WM_init_tablet_api(void)
+void WM_init_input_devices(void)
{
if (UNLIKELY(!g_system)) {
return;
}
+ GHOST_SetMultitouchGestures(g_system, (U.uiflag & USER_NO_MULTITOUCH_GESTURES) == 0);
+
switch (U.tablet_api) {
case USER_TABLET_NATIVE:
GHOST_SetTabletAPI(g_system, GHOST_kTabletWinPointer);