[Xfce4-commits] <midori:master> Focus the view on key press if nothing's focussed
Christian Dywan
noreply at xfce.org
Sun Mar 6 17:28:02 CET 2011
Updating branch refs/heads/master
to de0ede905f6b641677111cae785e0917024a7d56 (commit)
from 663e7e9285807130999aa9615635f7a037422956 (commit)
commit de0ede905f6b641677111cae785e0917024a7d56
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Mar 6 17:25:32 2011 +0100
Focus the view on key press if nothing's focussed
midori/midori-browser.c | 3 +++
midori/midori-view.c | 4 +---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 325aef9..584ca48 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -1671,6 +1671,9 @@ midori_browser_key_press_event (GtkWidget* widget,
GtkWidgetClass* widget_class;
guint clean_state;
+ if (gtk_window_get_focus (GTK_WINDOW (widget)) == NULL)
+ gtk_widget_grab_focus (midori_browser_get_current_tab (MIDORI_BROWSER (widget)));
+
if (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))
if (sokoke_window_activate_key (window, event))
return TRUE;
diff --git a/midori/midori-view.c b/midori/midori-view.c
index d0cb178..a193a97 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3285,10 +3285,8 @@ static gboolean
midori_view_focus_in_event (GtkWidget* widget,
GdkEventFocus* event)
{
- MidoriView* view = MIDORI_VIEW (widget);
-
/* Always propagate focus to the child web view */
- gtk_widget_grab_focus (view->web_view);
+ gtk_widget_grab_focus (midori_view_get_web_view (MIDORI_VIEW (widget)));
return TRUE;
}
More information about the Xfce4-commits
mailing list