Changeset 77694 in webkit


Ignore:
Timestamp:
Feb 4, 2011 4:11:01 PM (13 years ago)
Author:
Darin Adler
Message:

2011-02-04 Darin Adler <Darin Adler>

Reviewed by Dan Bernstein.

WebKit2 doesn't hide mouse pointer on keypress
https://bugs.webkit.org/show_bug.cgi?id=53821
rdar://problem/8630895

  • UIProcess/PageClient.h: Renamed didNotHandleKeyEvent to doneWithKeyEvent and added a bool wasEventHandled argument.
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): Changed code to call doneWithKeyEvent and call even if event was handled.
  • UIProcess/API/mac/PageClientImpl.h: Updated for above change.
  • UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent): Ditto. But also call [NSCursor setHiddenUntilMouseMoves:YES] when a key down event was handled. This matches what -[WebHTMLView keyDown:] does.
  • UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::doneWithKeyEvent): Ditto.
  • UIProcess/API/qt/qwkpage_p.h: Ditto.
  • UIProcess/win/WebView.cpp: (WebKit::WebView::doneWithKeyEvent): Ditto.
  • UIProcess/win/WebView.h: Ditto.
Location:
trunk/Source/WebKit2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r77678 r77694  
     12011-02-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        WebKit2 doesn't hide mouse pointer on keypress
     6        https://bugs.webkit.org/show_bug.cgi?id=53821
     7        rdar://problem/8630895
     8
     9        * UIProcess/PageClient.h: Renamed didNotHandleKeyEvent to
     10        doneWithKeyEvent and added a bool wasEventHandled argument.
     11        * UIProcess/WebPageProxy.cpp:
     12        (WebKit::WebPageProxy::didReceiveEvent): Changed code to call
     13        doneWithKeyEvent and call even if event was handled.
     14
     15        * UIProcess/API/mac/PageClientImpl.h: Updated for above change.
     16        * UIProcess/API/mac/PageClientImpl.mm:
     17        (WebKit::PageClientImpl::doneWithKeyEvent): Ditto. But also
     18        call [NSCursor setHiddenUntilMouseMoves:YES] when a key down
     19        event was handled. This matches what -[WebHTMLView keyDown:] does.
     20        * UIProcess/API/qt/qwkpage.cpp:
     21        (QWKPagePrivate::doneWithKeyEvent): Ditto.
     22        * UIProcess/API/qt/qwkpage_p.h: Ditto.
     23        * UIProcess/win/WebView.cpp:
     24        (WebKit::WebView::doneWithKeyEvent): Ditto.
     25        * UIProcess/win/WebView.h: Ditto.
     26
    1272011-02-04  Steve Falkenburg  <sfalken@apple.com>
    228
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h

    r77386 r77694  
    7777    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
    7878
    79     virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&);
     79    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
    8080
    8181    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm

    r77386 r77694  
    309309}
    310310
    311 void PageClientImpl::didNotHandleKeyEvent(const NativeWebKeyboardEvent& event)
     311void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool wasEventHandled)
    312312{
    313313    NSEvent* nativeEvent = event.nativeEvent();
    314     if ([nativeEvent type] == NSKeyDown) {
     314    if ([nativeEvent type] != NSKeyDown)
     315        return;
     316    if (wasEventHandled)
     317        [NSCursor setHiddenUntilMouseMoves:YES];
     318    else {
    315319        [m_wkView _setEventBeingResent:nativeEvent];
    316320        [[NSApplication sharedApplication] sendEvent:nativeEvent];
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp

    r77512 r77694  
    233233}
    234234
    235 void QWKPagePrivate::didNotHandleKeyEvent(const NativeWebKeyboardEvent&)
     235void QWKPagePrivate::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool)
    236236{
    237237}
  • trunk/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h

    r77365 r77694  
    8080    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
    8181    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
    82     virtual void didNotHandleKeyEvent(const WebKit::NativeWebKeyboardEvent&);
     82    virtual void doneWithKeyEvent(const WebKit::NativeWebKeyboardEvent&, bool wasEventHandled);
    8383    virtual void selectionChanged(bool, bool, bool, bool);
    8484    virtual PassRefPtr<WebKit::WebPopupMenuProxy> createPopupMenuProxy(WebKit::WebPageProxy*);
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r77386 r77694  
    110110    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;
    111111
    112     virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&) = 0;
     112    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0;
    113113
    114114    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) = 0;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r77667 r77694  
    22382238        m_keyEventQueue.removeFirst();
    22392239
     2240        m_pageClient->doneWithKeyEvent(event, handled);
     2241
    22402242        if (handled)
    22412243            break;
    22422244
    2243         m_pageClient->didNotHandleKeyEvent(event);
    22442245        m_uiClient.didNotHandleKeyEvent(this, event);
    22452246        break;
  • trunk/Source/WebKit2/UIProcess/win/WebView.cpp

    r77381 r77694  
    10041004}
    10051005
    1006 void WebView::didNotHandleKeyEvent(const NativeWebKeyboardEvent& event)
     1006void WebView::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool wasEventHandled)
    10071007{
    10081008    // Calling ::DefWindowProcW will ensure that pressing the Alt key will generate a WM_SYSCOMMAND
    10091009    // event, e.g. See <http://webkit.org/b/47671>.
    1010     ::DefWindowProcW(event.nativeEvent()->hwnd, event.nativeEvent()->message, event.nativeEvent()->wParam, event.nativeEvent()->lParam);
     1010    if (!wasEventHandled)
     1011        ::DefWindowProcW(event.nativeEvent()->hwnd, event.nativeEvent()->message, event.nativeEvent()->wParam, event.nativeEvent()->lParam);
    10111012}
    10121013
  • trunk/Source/WebKit2/UIProcess/win/WebView.h

    r77339 r77694  
    150150    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
    151151    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
    152     virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&);
     152    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
    153153    virtual void compositionSelectionChanged(bool);
    154154    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
Note: See TracChangeset for help on using the changeset viewer.