forward-port some fixes from a2

git-svn-id: svn://localhost/ardour2/branches/3.0@11630 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-03-09 17:15:25 +00:00
parent 3e3d831251
commit c52c2b7368
6 changed files with 46 additions and 2 deletions

View File

@ -370,6 +370,7 @@ Editor::Editor ()
layering_order_editor = 0;
no_save_visual = false;
resize_idle_id = -1;
within_track_canvas = false;
scrubbing_direction = 0;

View File

@ -714,6 +714,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void set_canvas_cursor ();
ArdourCanvas::Canvas* track_canvas;
bool within_track_canvas;
friend class VerboseCursor;
VerboseCursor* _verbose_cursor;

View File

@ -731,6 +731,7 @@ bool
Editor::left_track_canvas (GdkEventCrossing */*ev*/)
{
DropDownKeys ();
within_track_canvas = false;
set_entered_track (0);
set_entered_regionview (0);
reset_canvas_action_sensitivity (false);
@ -740,6 +741,7 @@ Editor::left_track_canvas (GdkEventCrossing */*ev*/)
bool
Editor::entered_track_canvas (GdkEventCrossing */*ev*/)
{
within_track_canvas = false;
reset_canvas_action_sensitivity (true);
return FALSE;
}

View File

@ -91,6 +91,21 @@ using Gtkmm2ext::Keyboard;
bool
Editor::mouse_frame (framepos_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;

View File

@ -488,7 +488,7 @@ EditorRoutes::show_menu ()
void
EditorRoutes::redisplay ()
{
if (_no_redisplay || !_session) {
if (_no_redisplay || !_session || _session->deletion_in_progress()) {
return;
}

View File

@ -417,7 +417,32 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
uint32_t fakekey = ev->keyval;
if (Gtkmm2ext::possibly_translate_keyval_to_make_legal_accelerator (fakekey)) {
if (allow_activating && gtk_accel_groups_activate(G_OBJECT(win), fakekey, GdkModifierType(ev->state))) {
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("\tactivate (was %1 now %2) without special hanlding of unmodified accels\n",
ev->keyval, fakekey));
GdkModifierType mod = GdkModifierType (ev->state);
mod = GdkModifierType (mod & gtk_accelerator_get_default_mod_mask());
#ifdef GTKOSX
/* GTK on OS X is currently (February 2012) setting both
the Meta and Mod2 bits in the event modifier state if
the Command key is down.
gtk_accel_groups_activate() does not invoke any of the logic
that gtk_window_activate_key() will that sorts out that stupid
state of affairs, and as a result it fails to find a match
for the key event and the current set of accelerators.
to fix this, if the meta bit is set, remove the mod2 bit
from the modifier. this assumes that our bindings use Primary
which will have set the meta bit in the accelerator entry.
*/
if (mod & GDK_META_MASK) {
mod = GdkModifierType (mod & ~GDK_MOD2_MASK);
}
#endif
if (allow_activating && gtk_accel_groups_activate(G_OBJECT(win), fakekey, mod)) {
DEBUG_TRACE (DEBUG::Accelerators, "\taccel group activated by fakekey\n");
return true;
}