From 71c54d4ca81eb9735c8d8b0d710667ac05798a5e Mon Sep 17 00:00:00 2001 From: gustav_b Date: Sun, 16 Sep 2007 15:30:50 +0000 Subject: Add handling of focus tabbing for GdlDockItem + various DockItem focus fixes. (bzr r3764) --- src/ui/widget/dock-item.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/ui/widget/dock-item.cpp') diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index d615de1ff..372fe5d9d 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -291,10 +291,19 @@ DockItem::present() void DockItem::grab_focus() { - if (GTK_WIDGET_REALIZED (_gdl_dock_item)) + if (GTK_WIDGET_REALIZED (_gdl_dock_item)) { + + // make sure the window we're in is present + Gtk::Widget *toplevel = getWidget().get_toplevel(); + if (Gtk::Window *window = dynamic_cast(toplevel)) { + window->present(); + } + gtk_widget_grab_focus (_gdl_dock_item); - else + + } else { _grab_focus_on_realize = true; + } } -- cgit v1.2.3