Changeset 86738 in webkit


Ignore:
Timestamp:
May 17, 2011 11:16:29 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-05-17 Jeremy Noble <jer.noble@apple.com>

Reviewed by Darin Adler.

Exiting full screen will leave up invisible full-screen window, blocking all mouse clicks.
https://bugs.webkit.org/show_bug.cgi?id=60982

The GraphicsLayer tree has unparented m_fullScreenRootLayer behind our backs, replacing the
tiled layer with a normal one. Instead of holding on to a specific layer, assume that the
w_rootLayer will only have 0 or 1 children, and if a child is present, then that is our full-
screen layer.

Additionally, check to see if the animating layer's presentationLayer is nil
before calling it; asking a nil object for a CATransform3D will give back a struct full of
garbage.

In WKFullScreenWindowController, when the exit animation completes, ignore the "completed"
parameter. This eliminates the possibility that the full screen window will end up left
on top of the screen if the animation is cancelled and a enter full screen animation isn't
forthcoming.

  • UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
  • WebProcess/FullScreen/mac/WebFullScreenManagerMac.h:
  • WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation):
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r86734 r86738  
     12011-05-17  Jeremy Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Exiting full screen will leave up invisible full-screen window, blocking all mouse clicks.
     6        https://bugs.webkit.org/show_bug.cgi?id=60982
     7
     8        The GraphicsLayer tree has unparented m_fullScreenRootLayer behind our backs, replacing the
     9        tiled layer with a normal one.  Instead of holding on to a specific layer, assume that the
     10        w_rootLayer will only have 0 or 1 children, and if a child is present, then that is our full-
     11        screen layer.
     12
     13        Additionally, check to see if the animating layer's presentationLayer is nil
     14        before calling it; asking a nil object for a CATransform3D will give back a struct full of
     15        garbage.
     16
     17        In WKFullScreenWindowController, when the exit animation completes, ignore the "completed"
     18        parameter.  This eliminates the possibility that the full screen window will end up left
     19        on top of the screen if the animation is cancelled and a enter full screen animation isn't
     20        forthcoming.
     21
     22        * UIProcess/mac/WKFullScreenWindowController.mm:
     23        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
     24        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h:
     25        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
     26        (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
     27        (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation):
     28        (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation):
     29
    1302011-05-17  Dan Bernstein  <mitz@apple.com>
    231
  • trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

    r86486 r86738  
    341341    NSDisableScreenUpdates();
    342342   
    343     if (completed) {
    344         [self _updateMenuAndDockForFullScreen];
    345         [self _updatePowerAssertions];
    346         [NSCursor setHiddenUntilMouseMoves:YES];
    347                
    348         [[self window] orderOut:self];
    349         [[_webView window] makeKeyAndOrderFront:self];
    350     }
    351    
     343    [self _updateMenuAndDockForFullScreen];
     344    [self _updatePowerAssertions];
     345    [NSCursor setHiddenUntilMouseMoves:YES];
     346    [[self window] orderOut:self];
     347    [[_webView window] makeKeyAndOrderFront:self];
     348
    352349    [self _manager]->didExitFullScreen();
    353350    NSEnableScreenUpdates();   
  • trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h

    r86588 r86738  
    5555
    5656    OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
    57     RetainPtr<PlatformLayer> m_fullScreenRootLayer;
    5857    LayerTreeContext m_layerTreeContext;
    5958    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
  • trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm

    r86588 r86738  
    132132void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* layer)
    133133{
    134     if (m_fullScreenRootLayer == (layer ? layer->platformLayer() : 0))
     134    if ((!m_rootLayer || m_rootLayer->children().isEmpty()) && !layer)
    135135        return;
    136136
    137137    if (!layer) {
    138138        m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode());
     139        [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_rootLayer->platformLayer() userInfo:nil];
    139140        if (m_rootLayer) {
    140141            m_rootLayer->removeAllChildren();
    141142            m_rootLayer = nullptr;
    142143        }
    143        
    144         [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_fullScreenRootLayer.get() userInfo:nil];
    145         m_fullScreenRootLayer = 0;
    146         return;
    147     }
    148    
     144
     145        return;
     146    }
     147
     148    if (m_rootLayer && m_rootLayer->children().contains(layer))
     149        return;
     150
    149151    if (!m_rootLayer) {
    150152        mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
     
    166168    m_rootLayer->removeAllChildren();
    167169    m_rootLayer->addChild(layer);
    168 
    169     m_rootLayer->syncCompositingStateForThisLayerOnly();
    170     m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
    171     m_fullScreenRootLayer = layer->platformLayer();
    172     layer->syncCompositingState();
    173 
    174     [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_fullScreenRootLayer.get() userInfo:nil];
     170    m_rootLayer->syncCompositingState();
     171
     172    [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_rootLayer->platformLayer() userInfo:nil];
    175173}
    176174
     
    179177    ASSERT(m_element);
    180178   
    181     if (!m_fullScreenRootLayer) {
     179    if (!m_rootLayer || m_rootLayer->children().isEmpty()) {
    182180        // If we don't have a root layer, we can't animate in and out of full screen
    183181        this->beganEnterFullScreenAnimation();
     
    188186    IntRect destinationFrame = getFullScreenRect();
    189187    m_element->document()->setFullScreenRendererSize(destinationFrame.size());
    190     m_rootLayer->syncCompositingStateForThisLayerOnly();
    191     m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
     188    m_rootLayer->syncCompositingState();
    192189
    193190    // FIXME: Once we gain the ability to do native WebKit animations of generated
    194191    // content, this can change to use them.  Meanwhile, we'll have to animate the
    195192    // CALayer directly:
    196     CALayer* caLayer = m_fullScreenRootLayer.get();
     193    CALayer* caLayer = m_rootLayer->children().first()->platformLayer();
    197194
    198195    // Create a transformation matrix that will transform the renderer layer such that
     
    234231    ASSERT(m_element);
    235232   
    236     if (!m_fullScreenRootLayer) {
     233    if (!m_rootLayer || m_rootLayer->children().isEmpty()) {
    237234        // If we don't have a root layer, we can't animate in and out of full screen
    238235        this->beganExitFullScreenAnimation();
     
    243240    IntRect destinationFrame = getFullScreenRect();
    244241    m_element->document()->setFullScreenRendererSize(destinationFrame.size());
    245     m_rootLayer->syncCompositingStateForThisLayerOnly();
    246     m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
     242    m_rootLayer->syncCompositingState();
    247243
    248244    // FIXME: Once we gain the ability to do native WebKit animations of generated
    249245    // content, this can change to use them.  Meanwhile, we'll have to animate the
    250246    // CALayer directly:
    251     CALayer* caLayer = m_fullScreenRootLayer.get();
     247    CALayer* caLayer = m_rootLayer->children().first()->platformLayer();
     248    CALayer* presentationLayer = [caLayer presentationLayer] ? (CALayer*)[caLayer presentationLayer] : caLayer;
    252249
    253250    // Create a transformation matrix that will transform the renderer layer such that
    254251    // the fullscreen element appears to move from its starting position and size to its
    255252    // final one.
    256     CGPoint destinationPosition = [(CALayer *)[caLayer presentationLayer] position];
    257     CGRect destinationBounds = [(CALayer *)[caLayer presentationLayer] bounds];
     253    CGPoint destinationPosition = [presentationLayer position];
     254    CGRect destinationBounds = [presentationLayer bounds];
    258255    CGPoint layerAnchor = [caLayer anchorPoint];
    259256    CGPoint initialPosition = CGPointMake(
     
    269266    CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, shiftTransform);
    270267
    271     CATransform3D initialTransform = [(CALayer*)[caLayer presentationLayer] transform];
     268    CATransform3D initialTransform = [presentationLayer transform];
    272269
    273270    // Use a CABasicAnimation here for the zoom effect. We want to be notified that the animation has
Note: See TracChangeset for help on using the changeset viewer.