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
This commit is contained in:
parent
c3fdfd2d56
commit
170514df72
|
@ -593,6 +593,7 @@ class Editor : public PublicEditor
|
||||||
ArdourCanvas::Canvas* track_canvas;
|
ArdourCanvas::Canvas* track_canvas;
|
||||||
ArdourCanvas::NoEventText* verbose_canvas_cursor;
|
ArdourCanvas::NoEventText* verbose_canvas_cursor;
|
||||||
bool verbose_cursor_visible;
|
bool verbose_cursor_visible;
|
||||||
|
bool within_track_canvas;
|
||||||
|
|
||||||
void parameter_changed (const char *);
|
void parameter_changed (const char *);
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ Editor::initialize_canvas ()
|
||||||
delete font;
|
delete font;
|
||||||
|
|
||||||
verbose_cursor_visible = false;
|
verbose_cursor_visible = false;
|
||||||
|
within_track_canvas = false;
|
||||||
|
|
||||||
/* on the bottom, an image */
|
/* on the bottom, an image */
|
||||||
|
|
||||||
|
@ -795,6 +796,7 @@ Editor::stop_canvas_autoscroll ()
|
||||||
bool
|
bool
|
||||||
Editor::left_track_canvas (GdkEventCrossing *ev)
|
Editor::left_track_canvas (GdkEventCrossing *ev)
|
||||||
{
|
{
|
||||||
|
within_track_canvas = false;
|
||||||
set_entered_track (0);
|
set_entered_track (0);
|
||||||
set_entered_regionview (0);
|
set_entered_regionview (0);
|
||||||
reset_canvas_action_sensitivity (false);
|
reset_canvas_action_sensitivity (false);
|
||||||
|
@ -804,6 +806,7 @@ Editor::left_track_canvas (GdkEventCrossing *ev)
|
||||||
bool
|
bool
|
||||||
Editor::entered_track_canvas (GdkEventCrossing *ev)
|
Editor::entered_track_canvas (GdkEventCrossing *ev)
|
||||||
{
|
{
|
||||||
|
within_track_canvas = true;
|
||||||
reset_canvas_action_sensitivity (true);
|
reset_canvas_action_sensitivity (true);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,21 @@ using namespace Editing;
|
||||||
bool
|
bool
|
||||||
Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const
|
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;
|
int x, y;
|
||||||
double wx, wy;
|
double wx, wy;
|
||||||
Gdk::ModifierType mask;
|
Gdk::ModifierType mask;
|
||||||
|
|
Loading…
Reference in New Issue