[vlc-devel] commit: Qt: FSC, don't move if you clicked on a button ( and not the plain controller ) (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sun Apr 26 20:34:04 CEST 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 26 20:32:53 2009 +0200| [e2c1890d2aae27eee323bd3e081f05b465a4ffff] | committer: Jean-Baptiste Kempf
Qt: FSC, don't move if you clicked on a button (and not the plain controller )
Close #2429 and #2460.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2c1890d2aae27eee323bd3e081f05b465a4ffff
---
modules/gui/qt4/components/controller.cpp | 12 +++++++++++-
modules/gui/qt4/components/controller.hpp | 1 +
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 56ac3d8..75f83f8 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -910,8 +910,11 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
*/
void FullscreenControllerWidget::mouseMoveEvent( QMouseEvent *event )
{
- if ( event->buttons() == Qt::LeftButton )
+ if( event->buttons() == Qt::LeftButton )
{
+ if( i_mouse_last_x == -1 || i_mouse_last_y == -1 )
+ return;
+
int i_moveX = event->globalX() - i_mouse_last_x;
int i_moveY = event->globalY() - i_mouse_last_y;
@@ -932,6 +935,12 @@ void FullscreenControllerWidget::mousePressEvent( QMouseEvent *event )
i_mouse_last_y = event->globalY();
}
+void FullscreenControllerWidget::mouseReleaseEvent( QMouseEvent *event )
+{
+ i_mouse_last_x = -1;
+ i_mouse_last_y = -1;
+}
+
/**
* On mouse go above FSC
*/
@@ -1095,6 +1104,7 @@ void FullscreenControllerWidget::fullscreenChanged( vout_thread_t *p_vout,
}
vlc_mutex_unlock( &lock );
}
+
/**
* Mouse change callback (show/hide the controller on mouse movement)
*/
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index 8d33768..4b43d56 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -244,6 +244,7 @@ protected:
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
+ virtual void mouseReleaseEvent( QMouseEvent *event );
virtual void enterEvent( QEvent *event );
virtual void leaveEvent( QEvent *event );
virtual void keyPressEvent( QKeyEvent *event );
More information about the vlc-devel
mailing list