[vlc-commits] Qt: make the mouse sensitivity in FSC configurable

Jean-Baptiste Kempf git at videolan.org
Sun Jan 19 17:45:48 CET 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Jan 19 17:44:31 2014 +0100| [98ed7f65a64c3c0a61bdd46184efcd4248c9e636] | committer: Jean-Baptiste Kempf

Qt: make the mouse sensitivity in FSC configurable

Close #9462

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98ed7f65a64c3c0a61bdd46184efcd4248c9e636
---

 modules/gui/qt4/components/controller.cpp |    6 ++++--
 modules/gui/qt4/components/controller.hpp |    1 +
 modules/gui/qt4/qt4.cpp                   |    5 +++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index a5b3856..ccbf6f3 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -770,6 +770,8 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
     f_opacity = var_InheritFloat( p_intf, "qt-fs-opacity" );
 #endif
 
+    i_sensitivity = var_InheritInteger( p_intf, "qt-fs-sensitivity" );
+
     vlc_mutex_init_recursive( &lock );
 
     DCONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
@@ -1185,8 +1187,8 @@ void FullscreenControllerWidget::mouseChanged( vout_thread_t *, int i_mousex, in
 
     b_toShow = false;
     if( ( i_mouse_last_move_x == -1 || i_mouse_last_move_y == -1 ) ||
-        ( abs( i_mouse_last_move_x - i_mousex ) > 2 ||
-          abs( i_mouse_last_move_y - i_mousey ) > 2 ) )
+        ( abs( i_mouse_last_move_x - i_mousex ) > i_sensitivity ||
+          abs( i_mouse_last_move_y - i_mousey ) > i_sensitivity ) )
     {
         i_mouse_last_move_x = i_mousex;
         i_mouse_last_move_y = i_mousey;
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index bfe68e9..b22e430 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -319,6 +319,7 @@ private:
     int i_mouse_last_move_y;
 
     bool isWideFSC;
+    int i_sensitivity;
 };
 
 #endif
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 926cb8d..d301094 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -177,6 +177,8 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 
 #define VOLUME_MAX_TEXT N_( "Maximum Volume displayed" )
 
+#define FULLSCREEN_CONTROL_PIXELS N_( "Fullscreen controller mouse sensitivity" )
+
 static const int i_notification_list[] =
     { NOTIFICATION_NEVER, NOTIFICATION_MINIMIZED, NOTIFICATION_ALWAYS };
 
@@ -272,6 +274,9 @@ vlc_module_begin ()
 
     add_integer_with_range( "qt-max-volume", 125, 60, 300, VOLUME_MAX_TEXT, VOLUME_MAX_TEXT, true)
 
+    add_integer_with_range( "qt-fs-sensitivity", 3, 0, 4000, FULLSCREEN_CONTROL_PIXELS,
+            FULLSCREEN_CONTROL_PIXELS, true)
+
     add_obsolete_bool( "qt-blingbling" )      /* Suppressed since 1.0.0 */
     add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */
 



More information about the vlc-commits mailing list