summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/dock-item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget/dock-item.cpp')
-rw-r--r--src/ui/widget/dock-item.cpp13
1 files changed, 11 insertions, 2 deletions
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<Gtk::Window *>(toplevel)) {
+ window->present();
+ }
+
gtk_widget_grab_focus (_gdl_dock_item);
- else
+
+ } else {
_grab_focus_on_realize = true;
+ }
}