Changeset 52124 in webkit


Ignore:
Timestamp:
Dec 14, 2009 2:45:35 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-14 Evan Stade <estade@chromium.org>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=32347
Chromium: Context menu launched by menu key has funky behavior

Make the context menu's position depend on the selection only when an
editable field has focus. Also, don't send multiple context menu events
for a single keypress.

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::keyEvent): (WebKit::WebViewImpl::sendContextMenuEvent):
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r52103 r52124  
     12009-12-14  Evan Stade  <estade@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=32347
     6        Chromium: Context menu launched by menu key has funky behavior
     7
     8        Make the context menu's position depend on the selection only when an
     9        editable field has focus. Also, don't send multiple context menu events
     10        for a single keypress.
     11
     12        * src/WebViewImpl.cpp:
     13        (WebKit::WebViewImpl::keyEvent):
     14        (WebKit::WebViewImpl::sendContextMenuEvent):
     15
    1162009-12-13  Sam Weinig  <sam@webkit.org>
    217
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r52103 r52124  
    454454
    455455#if PLATFORM(WIN_OS) || PLATFORM(LINUX)
    456     if ((!event.modifiers && (event.windowsKeyCode == VKEY_APPS))
    457         || ((event.modifiers == WebInputEvent::ShiftKey) && (event.windowsKeyCode == VKEY_F10))) {
     456    const WebInputEvent::Type contextMenuTriggeringEventType =
     457#if PLATFORM(WIN_OS)
     458        WebInputEvent::KeyUp;
     459#elif PLATFORM(LINUX)
     460        WebInputEvent::RawKeyDown;
     461#endif
     462
     463    if (((!event.modifiers && (event.windowsKeyCode == VKEY_APPS))
     464        || ((event.modifiers == WebInputEvent::ShiftKey) && (event.windowsKeyCode == VKEY_F10)))
     465        && event.type == contextMenuTriggeringEventType) {
    458466        sendContextMenuEvent(event);
    459467        return true;
     
    593601    IntPoint location;
    594602
    595     // The context menu event was generated from the keyboard, so show the
    596     // context menu by the current selection.
    597     Position start = mainFrameImpl->selection()->selection().start();
    598     Position end = mainFrameImpl->selection()->selection().end();
    599603
    600604    Frame* focusedFrame = page()->focusController()->focusedOrMainFrame();
    601605    Node* focusedNode = focusedFrame->document()->focusedNode();
    602 
    603     if (start.node() && end.node()) {
     606    Position start = mainFrameImpl->selection()->selection().start();
     607
     608    if (focusedFrame->editor() && focusedFrame->editor()->canEdit() && start.node()) {
    604609        RenderObject* renderer = start.node()->renderer();
    605610        if (!renderer)
Note: See TracChangeset for help on using the changeset viewer.