Title: [86738] trunk/Source/WebKit2
Revision
86738
Author
[email protected]
Date
2011-05-17 23:16:29 -0700 (Tue, 17 May 2011)

Log Message

2011-05-17  Jeremy Noble  <[email protected]>

        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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (86737 => 86738)


--- trunk/Source/WebKit2/ChangeLog	2011-05-18 06:12:12 UTC (rev 86737)
+++ trunk/Source/WebKit2/ChangeLog	2011-05-18 06:16:29 UTC (rev 86738)
@@ -1,3 +1,32 @@
+2011-05-17  Jeremy Noble  <[email protected]>
+
+        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):
+
 2011-05-17  Dan Bernstein  <[email protected]>
 
         Reviewed by Alice Liu.

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (86737 => 86738)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-05-18 06:12:12 UTC (rev 86737)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-05-18 06:16:29 UTC (rev 86738)
@@ -340,15 +340,12 @@
 
     NSDisableScreenUpdates();
     
-    if (completed) {
-        [self _updateMenuAndDockForFullScreen];
-        [self _updatePowerAssertions];
-        [NSCursor setHiddenUntilMouseMoves:YES];
-                
-        [[self window] orderOut:self];
-        [[_webView window] makeKeyAndOrderFront:self];
-    }
-    
+    [self _updateMenuAndDockForFullScreen];
+    [self _updatePowerAssertions];
+    [NSCursor setHiddenUntilMouseMoves:YES];
+    [[self window] orderOut:self];
+    [[_webView window] makeKeyAndOrderFront:self];
+
     [self _manager]->didExitFullScreen();
     NSEnableScreenUpdates();    
 }

Modified: trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h (86737 => 86738)


--- trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h	2011-05-18 06:12:12 UTC (rev 86737)
+++ trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h	2011-05-18 06:16:29 UTC (rev 86738)
@@ -54,7 +54,6 @@
     virtual void beginExitFullScreenAnimation(float duration);
 
     OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
-    RetainPtr<PlatformLayer> m_fullScreenRootLayer;
     LayerTreeContext m_layerTreeContext;
     RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
     RetainPtr<id> m_enterFullScreenListener;

Modified: trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm (86737 => 86738)


--- trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm	2011-05-18 06:12:12 UTC (rev 86737)
+++ trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm	2011-05-18 06:16:29 UTC (rev 86738)
@@ -131,21 +131,23 @@
 
 void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* layer)
 {
-    if (m_fullScreenRootLayer == (layer ? layer->platformLayer() : 0))
+    if ((!m_rootLayer || m_rootLayer->children().isEmpty()) && !layer)
         return;
 
     if (!layer) {
         m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode());
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_rootLayer->platformLayer() userInfo:nil];
         if (m_rootLayer) {
             m_rootLayer->removeAllChildren();
             m_rootLayer = nullptr;
         }
-        
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_fullScreenRootLayer.get() userInfo:nil];
-        m_fullScreenRootLayer = 0;
+
         return;
     }
-    
+
+    if (m_rootLayer && m_rootLayer->children().contains(layer))
+        return;
+
     if (!m_rootLayer) {
         mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
         m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort);
@@ -165,20 +167,16 @@
 
     m_rootLayer->removeAllChildren();
     m_rootLayer->addChild(layer);
+    m_rootLayer->syncCompositingState();
 
-    m_rootLayer->syncCompositingStateForThisLayerOnly();
-    m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
-    m_fullScreenRootLayer = layer->platformLayer();
-    layer->syncCompositingState();
-
-    [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_fullScreenRootLayer.get() userInfo:nil];
+    [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_rootLayer->platformLayer() userInfo:nil];
 }
 
 void WebFullScreenManagerMac::beginEnterFullScreenAnimation(float duration)
 {
     ASSERT(m_element);
     
-    if (!m_fullScreenRootLayer) {
+    if (!m_rootLayer || m_rootLayer->children().isEmpty()) {
         // If we don't have a root layer, we can't animate in and out of full screen
         this->beganEnterFullScreenAnimation();
         this->finishedEnterFullScreenAnimation(true);
@@ -187,13 +185,12 @@
 
     IntRect destinationFrame = getFullScreenRect();
     m_element->document()->setFullScreenRendererSize(destinationFrame.size());
-    m_rootLayer->syncCompositingStateForThisLayerOnly();
-    m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
+    m_rootLayer->syncCompositingState();
 
     // FIXME: Once we gain the ability to do native WebKit animations of generated
     // content, this can change to use them.  Meanwhile, we'll have to animate the
     // CALayer directly:
-    CALayer* caLayer = m_fullScreenRootLayer.get();
+    CALayer* caLayer = m_rootLayer->children().first()->platformLayer();
 
     // Create a transformation matrix that will transform the renderer layer such that
     // the fullscreen element appears to move from its starting position and size to its
@@ -233,7 +230,7 @@
 {
     ASSERT(m_element);
     
-    if (!m_fullScreenRootLayer) {
+    if (!m_rootLayer || m_rootLayer->children().isEmpty()) {
         // If we don't have a root layer, we can't animate in and out of full screen
         this->beganExitFullScreenAnimation();
         this->finishedExitFullScreenAnimation(true);
@@ -242,19 +239,19 @@
 
     IntRect destinationFrame = getFullScreenRect();
     m_element->document()->setFullScreenRendererSize(destinationFrame.size());
-    m_rootLayer->syncCompositingStateForThisLayerOnly();
-    m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
+    m_rootLayer->syncCompositingState();
 
     // FIXME: Once we gain the ability to do native WebKit animations of generated
     // content, this can change to use them.  Meanwhile, we'll have to animate the
     // CALayer directly:
-    CALayer* caLayer = m_fullScreenRootLayer.get();
+    CALayer* caLayer = m_rootLayer->children().first()->platformLayer();
+    CALayer* presentationLayer = [caLayer presentationLayer] ? (CALayer*)[caLayer presentationLayer] : caLayer;
 
     // Create a transformation matrix that will transform the renderer layer such that
     // the fullscreen element appears to move from its starting position and size to its
     // final one.
-    CGPoint destinationPosition = [(CALayer *)[caLayer presentationLayer] position];
-    CGRect destinationBounds = [(CALayer *)[caLayer presentationLayer] bounds];
+    CGPoint destinationPosition = [presentationLayer position];
+    CGRect destinationBounds = [presentationLayer bounds];
     CGPoint layerAnchor = [caLayer anchorPoint];
     CGPoint initialPosition = CGPointMake(
         m_initialFrame.x() + m_initialFrame.width() * layerAnchor.x,
@@ -268,7 +265,7 @@
         destinationPosition.y - initialPosition.y, 0);
     CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, shiftTransform);
 
-    CATransform3D initialTransform = [(CALayer*)[caLayer presentationLayer] transform];
+    CATransform3D initialTransform = [presentationLayer transform];
 
     // Use a CABasicAnimation here for the zoom effect. We want to be notified that the animation has
     // completed by way of the CAAnimation delegate.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to