Changeset 195451 in webkit


Ignore:
Timestamp:
Jan 22, 2016 8:50:17 AM (8 years ago)
Author:
Brent Fulgham
Message:

[Mac] Tooltips do not honor some types of obscuring windows
https://bugs.webkit.org/show_bug.cgi?id=153263
<rdar://problem/21423972>

Reviewed by Simon Fraser.

Source/WebKit/mac:

  • WebView/WebHTMLView.mm:

(-[WebHTMLView _updateMouseoverWithEvent:]): When the WebView is not the key window, don't
display tooltips.

Source/WebKit2:

Recognize that the current WebView is obscured by comparing the current event's Window Number against
the Window Number of the current WebView. If they don't match, something is in the way.

  • UIProcess/Cocoa/WebViewImpl.h:
  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::windowIsFrontWindowUnderMouse): Added.

  • UIProcess/PageClient.h:

(WebKit::PageClient::windowIsFrontWindowUnderMouse):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::handleMouseEvent): Check if the current WebView is obscured. If it
is, clear the tooltip and return.

  • UIProcess/mac/PageClientImpl.h:
  • UIProcess/mac/PageClientImpl.mm:

(WebKit::PageClientImpl::windowIsFrontWindowUnderMouse): Added.

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r195412 r195451  
     12016-01-21  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Mac] Tooltips do not honor some types of obscuring windows
     4        https://bugs.webkit.org/show_bug.cgi?id=153263
     5        <rdar://problem/21423972>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * WebView/WebHTMLView.mm:
     10        (-[WebHTMLView _updateMouseoverWithEvent:]): When the WebView is not the key window, don't
     11        display tooltips.
     12
    1132016-01-19  Ada Chan  <adachan@apple.com>
    214
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r194496 r195451  
    11/*
    2  * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2005-2010, 2016 Apple Inc. All rights reserved.
    33 *           (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com)
    44 *
     
    21372137                ) {
    21382138                coreFrame->eventHandler().mouseMoved(event, [[self _webView] _pressureEvent]);
    2139             } else
     2139            } else {
     2140                [self removeAllToolTips];
    21402141                coreFrame->eventHandler().passMouseMovedEventToScrollbars(event, [[self _webView] _pressureEvent]);
     2142            }
    21412143        }
    21422144
  • trunk/Source/WebKit2/ChangeLog

    r195450 r195451  
     12016-01-21  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Mac] Tooltips do not honor some types of obscuring windows
     4        https://bugs.webkit.org/show_bug.cgi?id=153263
     5        <rdar://problem/21423972>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Recognize that the current WebView is obscured by comparing the current event's Window Number against
     10        the Window Number of the current WebView. If they don't match, something is in the way.
     11
     12        * UIProcess/Cocoa/WebViewImpl.h:
     13        * UIProcess/Cocoa/WebViewImpl.mm:
     14        (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse): Added.
     15        * UIProcess/PageClient.h:
     16        (WebKit::PageClient::windowIsFrontWindowUnderMouse):
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::handleMouseEvent): Check if the current WebView is obscured. If it
     19        is, clear the tooltip and return.
     20        * UIProcess/mac/PageClientImpl.h:
     21        * UIProcess/mac/PageClientImpl.mm:
     22        (WebKit::PageClientImpl::windowIsFrontWindowUnderMouse): Added.
     23
    1242016-01-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    225
  • trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h

    r195421 r195451  
    479479    void webViewImplAdditionsWillDestroyView();
    480480
     481    bool windowIsFrontWindowUnderMouse(NSEvent *);
     482
    481483#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && USE(APPLE_INTERNAL_SDK)
    482484#import <WebKitAdditions/WebViewImplAdditions.h>
  • trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm

    r195421 r195451  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    39733973}
    39743974
     3975bool WebViewImpl::windowIsFrontWindowUnderMouse(NSEvent *event)
     3976{
     3977    NSRect eventScreenPosition = [m_view.window convertRectToScreen:NSMakeRect(event.locationInWindow.x, event.locationInWindow.y, 0, 0)];
     3978    NSInteger eventWindowNumber = [NSWindow windowNumberAtPoint:eventScreenPosition.origin belowWindowWithWindowNumber:0];
     3979       
     3980    return m_view.window.windowNumber != eventWindowNumber;
     3981}
     3982
     3983   
    39753984} // namespace WebKit
    39763985
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r195231 r195451  
    11/*
    2  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6060class DrawingAreaProxy;
    6161class NativeWebKeyboardEvent;
     62class NativeWebMouseEvent;
    6263class RemoteLayerTreeTransaction;
    6364class ViewSnapshot;
     
    358359
    359360    virtual void didRestoreScrollPosition() = 0;
     361
     362    virtual bool windowIsFrontWindowUnderMouse(const NativeWebMouseEvent&) { return false; }
    360363};
    361364
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r195295 r195451  
    11/*
    2  * Copyright (C) 2010, 2011, 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011, 2015-2016 Apple Inc. All rights reserved.
    33 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    44 *
     
    16681668        return;
    16691669
     1670    if (m_pageClient.windowIsFrontWindowUnderMouse(event))
     1671        setToolTip(String());
     1672
    16701673    // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
    16711674    if (event.type() != WebEvent::MouseMove)
  • trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h

    r192898 r195451  
    11/*
    2  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    240240
    241241    virtual void didRestoreScrollPosition() override;
     242    virtual bool windowIsFrontWindowUnderMouse(const NativeWebMouseEvent&) override;
    242243};
    243244
  • trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm

    r194318 r195451  
    11/*
    2  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535#import "NativeWebGestureEvent.h"
    3636#import "NativeWebKeyboardEvent.h"
     37#import "NativeWebMouseEvent.h"
    3738#import "NativeWebWheelEvent.h"
    3839#import "NavigationState.h"
     
    831832}
    832833
     834bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event)
     835{
     836    return m_impl->windowIsFrontWindowUnderMouse(event.nativeEvent());
     837}
     838
    833839} // namespace WebKit
    834840
Note: See TracChangeset for help on using the changeset viewer.