Changeset 85900 in webkit


Ignore:
Timestamp:
May 5, 2011 4:56:19 PM (13 years ago)
Author:
weinig@apple.com
Message:

2011-05-05 Sam Weinig <sam@webkit.org>

Reviewed by Anders Carlsson.

WebKit2 (Mac): Background tabs/windows can force themselves to the front
<rdar://problem/9386346>
https://bugs.webkit.org/show_bug.cgi?id=60315

  • platform/mac/WidgetMac.mm: (WebCore::Widget::setFocus): It is incorrect for us to call Chrome::focus() here, which could bring a window/tab to the front. Calling focusNSView() was only necessary because in WebKit we must inform the platform widget that the focus has changed. WebKit2 Mac now matches other ports.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85895 r85900  
     12011-05-05  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        WebKit2 (Mac): Background tabs/windows can force themselves to the front
     6        <rdar://problem/9386346>
     7        https://bugs.webkit.org/show_bug.cgi?id=60315
     8
     9        * platform/mac/WidgetMac.mm:
     10        (WebCore::Widget::setFocus):
     11        It is incorrect for us to call Chrome::focus() here, which could bring a window/tab
     12        to the front. Calling focusNSView() was only necessary because in WebKit we must inform
     13        the platform widget that the focus has changed. WebKit2 Mac now matches other ports.
     14
    1152011-05-05  Justin Novosad  <junov@chromium.org>
    216
  • trunk/Source/WebCore/platform/mac/WidgetMac.mm

    r85036 r85900  
    104104void Widget::setFocus(bool focused)
    105105{
     106    if (!platformWidget())
     107        return;
     108
    106109    if (!focused)
    107110        return;
     
    113116    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    114117 
    115     // If there's no platformWidget, WK2 is running. The focus() method needs to be used
    116     // to bring focus to the right view on the UIProcess side.
    117118    NSView *view = [platformWidget() _webcore_effectiveFirstResponder];
    118     if (Page* page = frame->page()) {
    119         if (!platformWidget())
    120             page->chrome()->focus();
    121         else
    122             page->chrome()->focusNSView(view);
    123     }
     119    if (Page* page = frame->page())
     120        page->chrome()->focusNSView(view);
     121
    124122    END_BLOCK_OBJC_EXCEPTIONS;
    125123}
Note: See TracChangeset for help on using the changeset viewer.