⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248291 in webkit


Ignore:
Timestamp:
Aug 5, 2019, 11:47:10 PM (7 years ago)
Author:
Fujii Hironori
Message:

Source/WebKit:
[Win][MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
https://bugs.webkit.org/show_bug.cgi?id=200464

Reviewed by Ross Kirsling.

  • UIProcess/API/C/WKNativeEvent.h: Define WKNativeEventPtr for WIN32.

Tools:
[MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
https://bugs.webkit.org/show_bug.cgi?id=200464

Reviewed by Ross Kirsling.

When WK2 WebView is focused, short cut keys (e.g. Alt-F to open File
menu, Alt-F4 to close window, and etc) don't work.

WK1 WebView doesn't have this issue because it processes key events
properly.

  • MiniBrowser/win/WebKitBrowserWindow.cpp:

(WebKitBrowserWindow::WebKitBrowserWindow):
(WebKitBrowserWindow::didNotHandleKeyEvent): Added. Send the
unhandled key events to the main window.

  • MiniBrowser/win/WebKitBrowserWindow.h:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r248282 r248291  
     12019-08-05  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [Win][MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
     4        https://bugs.webkit.org/show_bug.cgi?id=200464
     5
     6        Reviewed by Ross Kirsling.
     7
     8        * UIProcess/API/C/WKNativeEvent.h: Define WKNativeEventPtr for WIN32.
     9
    1102019-08-05  Youenn Fablet  <youenn@apple.com>
    211
  • trunk/Source/WebKit/UIProcess/API/C/WKNativeEvent.h

    r191856 r248291  
    4747typedef union _GdkEvent GdkEvent;
    4848typedef const GdkEvent* WKNativeEventPtr;
     49#elif defined(WIN32)
     50typedef const struct tagMSG* WKNativeEventPtr;
    4951#else
    5052typedef const void* WKNativeEventPtr;
  • trunk/Tools/ChangeLog

    r248281 r248291  
     12019-08-05  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
     4        https://bugs.webkit.org/show_bug.cgi?id=200464
     5
     6        Reviewed by Ross Kirsling.
     7
     8        When WK2 WebView is focused, short cut keys (e.g. Alt-F to open File
     9        menu, Alt-F4 to close window, and etc) don't work.
     10
     11        WK1 WebView doesn't have this issue because it processes key events
     12        properly.
     13
     14        * MiniBrowser/win/WebKitBrowserWindow.cpp:
     15        (WebKitBrowserWindow::WebKitBrowserWindow):
     16        (WebKitBrowserWindow::didNotHandleKeyEvent): Added. Send the
     17        unhandled key events to the main window.
     18        * MiniBrowser/win/WebKitBrowserWindow.h:
     19
    1202019-08-05  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp

    r248029 r248291  
    146146    uiClient.base.clientInfo = this;
    147147    uiClient.createNewPage = createNewPage;
     148    uiClient.didNotHandleKeyEvent = didNotHandleKeyEvent;
    148149    WKPageSetPageUIClient(page, &uiClient.base);
    149150
     
    378379    return newPage.leakRef();
    379380}
     381
     382void WebKitBrowserWindow::didNotHandleKeyEvent(WKPageRef, WKNativeEventPtr event, const void* clientInfo)
     383{
     384    auto& thisWindow = toWebKitBrowserWindow(clientInfo);
     385    DefWindowProc(thisWindow.hwnd(), event->message, event->wParam, event->lParam);
     386}
  • trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.h

    r248029 r248291  
    7070    static void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef, const void*);
    7171    static WKPageRef createNewPage(WKPageRef, WKPageConfigurationRef, WKNavigationActionRef, WKWindowFeaturesRef, const void *);
     72    static void didNotHandleKeyEvent(WKPageRef, WKNativeEventPtr, const void*);
    7273
    7374    WKRetainPtr<WKViewRef> m_view;
Note: See TracChangeset for help on using the changeset viewer.