2008-01-18 Luca Bruno <lethalman88@gmail.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Jan 2008 07:49:53 +0000 (07:49 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Jan 2008 07:49:53 +0000 (07:49 +0000)
        Reviewed by Alp Toker.

        http://bugs.webkit.org/show_bug.cgi?id=16910
        [GTK] REGRESSION: keyboard cursor doesn't blink

        http://bugs.webkit.org/show_bug.cgi?id=16863
        [GTK] REGRESSION: tab focusing doesn't work

        * WebView/webkitwebview.cpp:
        (webkit_web_view_focus_in_event): Added. Set the active frame.
        (webkit_web_view_class_init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29665 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/gtk/ChangeLog
WebKit/gtk/WebView/webkitwebview.cpp

index caaadd6abb5e38db2117da6fdab5e58862208417..6f5b614a43ab0aadf7860f59b9464de6f2016af4 100644 (file)
@@ -1,3 +1,17 @@
+2008-01-18  Luca Bruno  <lethalman88@gmail.com>
+
+        Reviewed by Alp Toker.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16910
+        [GTK] REGRESSION: keyboard cursor doesn't blink
+
+        http://bugs.webkit.org/show_bug.cgi?id=16863
+        [GTK] REGRESSION: tab focusing doesn't work
+
+        * WebView/webkitwebview.cpp:
+        (webkit_web_view_focus_in_event): Added. Set the active frame.
+        (webkit_web_view_class_init):
+
 2008-01-16  Alp Toker  <alp@atoker.com>
 
         Reviewed by Mark Rowe.
 2008-01-16  Alp Toker  <alp@atoker.com>
 
         Reviewed by Mark Rowe.
index f8cc766240d219100dd6e6f0d420f7f4eef0a746..f96d3c406cc3e1999ac862a19bb23474373e3fa7 100644 (file)
@@ -339,6 +339,19 @@ static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allo
     frame->view()->adjustViewSize();
 }
 
     frame->view()->adjustViewSize();
 }
 
+static gboolean webkit_web_view_focus_in_event(GtkWidget* widget, GdkEventFocus* event)
+{
+    // TODO: Improve focus handling as suggested in
+    // http://bugs.webkit.org/show_bug.cgi?id=16910
+    GtkWidget* toplevel = gtk_widget_get_toplevel(widget);
+    if (GTK_WIDGET_TOPLEVEL(toplevel) && gtk_window_has_toplevel_focus(GTK_WINDOW(toplevel))) {
+        WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
+        Frame* frame = core(webkit_web_view_get_main_frame(webView));
+        core(webView)->focusController()->setActive(frame);
+    }
+    return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event);
+}
+
 static void webkit_web_view_realize(GtkWidget* widget)
 {
     GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
 static void webkit_web_view_realize(GtkWidget* widget)
 {
     GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
@@ -929,6 +942,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
     widgetClass->scroll_event = webkit_web_view_scroll_event;
     widgetClass->size_allocate = webkit_web_view_size_allocate;
     widgetClass->popup_menu = webkit_web_view_popup_menu_handler;
     widgetClass->scroll_event = webkit_web_view_scroll_event;
     widgetClass->size_allocate = webkit_web_view_size_allocate;
     widgetClass->popup_menu = webkit_web_view_popup_menu_handler;
+    widgetClass->focus_in_event = webkit_web_view_focus_in_event;
 
     GtkContainerClass* containerClass = GTK_CONTAINER_CLASS(webViewClass);
     containerClass->add = webkit_web_view_container_add;
 
     GtkContainerClass* containerClass = GTK_CONTAINER_CLASS(webViewClass);
     containerClass->add = webkit_web_view_container_add;