From 8aa1dfca0527f788404ab9807b9b35cda7e34061 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 1 Oct 2009 20:52:07 +0000 Subject: [PATCH] visual state patches from 2.X git-svn-id: svn://localhost/ardour2/branches/3.0@5712 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 7 ++++++- gtk2_ardour/keyboard.cc | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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(); -- 2.30.2