summaryrefslogtreecommitdiff
path: root/src/mplayerwindow.cpp
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2013-03-29 20:34:22 +0100
committerReinhard Tartler <siretart@tauware.de>2013-03-29 20:34:22 +0100
commit228d763f5a95a2575a18e03e0ea77555106023c4 (patch)
tree1eb49f0c372de4eef020e4c7e1716248622a7f0b /src/mplayerwindow.cpp
parent038de1a143b9775f37d4848f52c59af7cee66e36 (diff)
Imported Upstream version 0.8.4
Diffstat (limited to 'src/mplayerwindow.cpp')
-rw-r--r--src/mplayerwindow.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mplayerwindow.cpp b/src/mplayerwindow.cpp
index d4ef168..bfaa26f 100644
--- a/src/mplayerwindow.cpp
+++ b/src/mplayerwindow.cpp
@@ -1,5 +1,5 @@
/* smplayer, GUI front-end for mplayer.
- Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net>
+ Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -171,7 +171,7 @@ void MplayerLayer::playingStopped() {
/* ---------------------------------------------------------------------- */
MplayerWindow::MplayerWindow(QWidget* parent, Qt::WindowFlags f)
- : Screen(parent, f) , allow_video_movement(false)
+ : Screen(parent, f), allow_video_movement(false), moving_window(false)
{
offset_x = 0;
offset_y = 0;
@@ -368,7 +368,15 @@ void MplayerWindow::updateVideoWindow()
void MplayerWindow::mouseReleaseEvent( QMouseEvent * e) {
- qDebug( "MplayerWindow::mouseReleaseEvent" );
+ qDebug( "MplayerWindow::mouseReleaseEvent" );
+
+ //qDebug( "MplayerWindow::mouseReleaseEvent: moving_window: %d", moving_window );
+
+ // Ignore mouse events if the window is been moved
+ if (moving_window) {
+ e->accept();
+ return;
+ }
if (e->button() == Qt::LeftButton) {
e->accept();
@@ -438,6 +446,10 @@ bool MplayerWindow::eventFilter( QObject * /*watched*/, QEvent * event ) {
emit mouseMovedDiff( mouse_event->globalPos() - mouse_press_pos);
mouse_press_pos = mouse_event->globalPos();
/* qDebug("MplayerWindow::eventFilter: mouse_press_pos: x: %d y: %d", mouse_press_pos.x(), mouse_press_pos.y()); */
+ moving_window = true;
+ }
+ else {
+ moving_window = false;
}
}
}
@@ -447,6 +459,8 @@ bool MplayerWindow::eventFilter( QObject * /*watched*/, QEvent * event ) {
mouse_press_pos = mouse_event->globalPos();
}
+ //qDebug("moving_window: %d", moving_window);
+
return false;
}