summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-11-12 20:03:58 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-11-12 20:03:58 +0000
commitb76635a8fd57adab6064b090736bae14af49624c (patch)
tree93a9f87bdc98806bd7297def611b909a32591058 /gtk2_ardour/utils.cc
parent94f413a88fce91ef4dc9c698756fe1b5f76c428e (diff)
fix key handling in region layering dialog; shortcut for pixel_width() called on an empty string
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6073 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 99a56f355e..49bd38b6f4 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -54,6 +54,10 @@ sigc::signal<void> DPIReset;
int
pixel_width (const ustring& str, Pango::FontDescription& font)
{
+ if (str.empty()) {
+ return 0;
+ }
+
Label foo;
Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout ("");
@@ -429,6 +433,9 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
if (GTK_IS_ENTRY(focus) || Keyboard::some_magic_widget_has_focus()) {
special_handling_of_unmodified_accelerators = true;
}
+#ifdef DEBUG_ACCELERATOR_HANDLING
+ cerr << "Focus widget name " << gtk_widget_get_name(focus) << endl;
+#endif
}
#ifdef GTKOSX