diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index d23c83eaf1..55e8014638 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6600,7 +6600,12 @@ Editor::cancel_visual_state_op (uint32_t n) if (!visual_state_op_connection.empty()) { visual_state_op_connection.disconnect(); goto_visual_state (n); - } + } else { + //we land here if called from the menu OR if end_visual_state_op has been called + //so check if we are already in visual state n + // XXX not yet checking it at all, but redoing does not hurt + goto_visual_state (n); + } } bool diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc index 157cfffd01..1cbe6bee0f 100644 --- a/gtk2_ardour/keyboard.cc +++ b/gtk2_ardour/keyboard.cc @@ -236,7 +236,7 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event) const AccelKey& ak (k->first); - if (keyval == ak.get_key() && (Gdk::ModifierType)(event->state | Gdk::RELEASE_MASK) == ak.get_mod()) { + if (keyval == ak.get_key() && (Gdk::ModifierType)((event->state & Keyboard::RelevantModifierKeyMask) | Gdk::RELEASE_MASK) == ak.get_mod()) { cerr << "Suppress auto repeat\n"; ret = true; break; @@ -258,7 +258,7 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event) const AccelKey& ak (k->first); two_strings ts (k->second); - if (keyval == ak.get_key() && (Gdk::ModifierType)(event->state | Gdk::RELEASE_MASK) == ak.get_mod()) { + if (keyval == ak.get_key() && (Gdk::ModifierType)((event->state & Keyboard::RelevantModifierKeyMask) | Gdk::RELEASE_MASK) == ak.get_mod()) { Glib::RefPtr act = ActionManager::get_action (ts.first.c_str(), ts.second.c_str()); if (act) { act->activate();