# HG changeset patch # User Chris Cannam # Date 1197641825 0 # Node ID 998786b3174ff1c9a004442ba505d7919be2e219 # Parent ffa448b0e1bc57fa24f6cf236d04b0c6b2b740fd ... diff -r ffa448b0e1bc -r 998786b3174f view/Pane.cpp --- a/view/Pane.cpp Thu Dec 13 17:14:33 2007 +0000 +++ b/view/Pane.cpp Fri Dec 14 14:17:05 2007 +0000 @@ -1211,6 +1211,26 @@ return; } + std::cerr << "mousePressEvent" << std::endl; + + + //!!! need to avoid spurious mouse events when e.g. double-clicking. + + // when double clicking, we get: + // mousePressEvent + // mouseReleaseEvent + // mouseMoveEvent <- called from mouseReleaseEvent + // mouseDoubleClickEvent + // mouseReleaseEvent + // mouseMoveEvent <- called from mouseReleaseEvent + + // so we set a timer on the first press, if we're in a mode in + // which moving the mouse will do something + + // the move method doesn't do anything unless that timer has + // elapsed + + m_clickPos = e->pos(); m_mousePos = m_clickPos; m_clickedInRange = true; @@ -1329,6 +1349,8 @@ return; } + std::cerr << "mouseReleaseEvent" << std::endl; + ViewManager::ToolMode mode = ViewManager::NavigateMode; if (m_manager) mode = m_manager->getToolMode(); @@ -1426,6 +1448,13 @@ return; } + std::cerr << "mouseMoveEvent" << std::endl; + + //!!! if no buttons pressed, and not called from + //mouseReleaseEvent, we want to reset clicked-ness (to avoid + //annoying continual drags when we moved the mouse outside the + //window after pressing button first time). + updateContextHelp(&e->pos()); ViewManager::ToolMode mode = ViewManager::NavigateMode; @@ -1799,7 +1828,7 @@ return; } -// std::cerr << "mouseDoubleClickEvent" << std::endl; + std::cerr << "mouseDoubleClickEvent" << std::endl; m_clickPos = e->pos(); m_clickedInRange = true;