Changeset 260996 in webkit


Ignore:
Timestamp:
May 1, 2020, 5:23:54 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Move focus out of the web view when tab is pressed and there isn't a next element to focus
https://bugs.webkit.org/show_bug.cgi?id=211283

Reviewed by Adrian Perez de Castro.

Implement API::UIClient::takeFocus() that is called when WebCore wants to focus the chrome.

  • UIProcess/API/glib/WebKitUIClient.cpp:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r260994 r260996  
     12020-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Move focus out of the web view when tab is pressed and there isn't a next element to focus
     4        https://bugs.webkit.org/show_bug.cgi?id=211283
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        Implement API::UIClient::takeFocus() that is called when WebCore wants to focus the chrome.
     9
     10        * UIProcess/API/glib/WebKitUIClient.cpp:
     11
    1122020-05-01  David Kilzer  <ddkilzer@apple.com>
    213
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp

    r260752 r260996  
    295295
    296296#if PLATFORM(GTK)
     297    bool takeFocus(WebPageProxy* page, WKFocusDirection direction) final
     298    {
     299        if (!gtk_widget_has_focus(GTK_WIDGET(m_webView))) {
     300            focus(page);
     301            return true;
     302        }
     303        return gtk_widget_child_focus(gtk_widget_get_toplevel(GTK_WIDGET(m_webView)), direction == kWKFocusDirectionBackward ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD);
     304    }
     305
     306    void focus(WebPageProxy*) final
     307    {
     308        gtk_widget_grab_focus(GTK_WIDGET(m_webView));
     309    }
     310
    297311    void printFrame(WebPageProxy&, WebFrameProxy& frame, CompletionHandler<void()>&& completionHandler) final
    298312    {
Note: See TracChangeset for help on using the changeset viewer.