summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-03-09 16:56:45 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-03-09 16:56:45 +0000
commit170514df723fe6e8898026f15063de53d72846c7 (patch)
tree0633f7defef974bc77c7dc41f12ef0c56af3a001 /gtk2_ardour/editor_mouse.cc
parentc3fdfd2d56c66c1ea6aeb190ef3b339a1792d685 (diff)
fix odd behaviour of gdk_window_get_pointer(), used to determine if the mouse pointer is inside the track canvas
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@11626 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index e1e4faa44e..c5830b243d 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -73,6 +73,21 @@ using namespace Editing;
bool
Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const
{
+ /* gdk_window_get_pointer() has X11's XQueryPointer semantics in that it only
+ pays attentions to subwindows. this means that menu windows are ignored, and
+ if the pointer is in a menu, the return window from the call will be the
+ the regular subwindow *under* the menu.
+
+ this matters quite a lot if the pointer is moving around in a menu that overlaps
+ the track canvas because we will believe that we are within the track canvas
+ when we are not. therefore, we track enter/leave events for the track canvas
+ and allow that to override the result of gdk_window_get_pointer().
+ */
+
+ if (!within_track_canvas) {
+ return false;
+ }
+
int x, y;
double wx, wy;
Gdk::ModifierType mask;