diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-14 03:43:54 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-14 03:43:54 +0000 |
commit | af707897735a34ab1a82c7307dc61b12c14027a9 (patch) | |
tree | b2a9fc621c4a5d7865a46f09eb5cafeee959a9a1 /gtk2_ardour/utils.cc | |
parent | 1a52aeb370c9fabbd2229da793aee0399f04ca2f (diff) |
improvements (!) to waveform display for destructive tracks, plus a generic fix that avoid waveview attemting to read peaks before they are ready
git-svn-id: svn://localhost/trunk/ardour2@388 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 19d896fd0d..91f69a444e 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -512,6 +512,14 @@ bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) { GtkWindow* win = window.gobj(); + GtkWidget* focus = gtk_window_get_focus (win); + bool special_handling_of_unmodified_accelerators = false; + + if (focus) { + if (GTK_IS_ENTRY(focus)) { + special_handling_of_unmodified_accelerators = true; + } + } /* This exists to allow us to override the way GTK handles key events. The normal sequence is: @@ -544,9 +552,17 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) all "normal text" accelerators. */ - if (ev->state & ~Gdk::SHIFT_MASK) { - - /* modifiers in effect, accelerate first */ + if (!special_handling_of_unmodified_accelerators || + ev->state & (Gdk::MOD1_MASK| + Gdk::MOD2_MASK| + Gdk::MOD3_MASK| + Gdk::MOD4_MASK| + Gdk::MOD5_MASK| + Gdk::CONTROL_MASK| + Gdk::LOCK_MASK)) { + + /* no special handling or modifiers in effect: accelerate first */ + if (!gtk_window_activate_key (win, ev)) { return gtk_window_propagate_key_event (win, ev); } else { @@ -555,7 +571,7 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) } /* no modifiers, propagate first */ - + if (!gtk_window_propagate_key_event (win, ev)) { return gtk_window_activate_key (win, ev); } |