Changeset 86738 in webkit
- Timestamp:
- May 17, 2011 11:16:29 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86734 r86738 1 2011-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 1 30 2011-05-17 Dan Bernstein <mitz@apple.com> 2 31 -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
r86486 r86738 341 341 NSDisableScreenUpdates(); 342 342 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 352 349 [self _manager]->didExitFullScreen(); 353 350 NSEnableScreenUpdates(); -
trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h
r86588 r86738 55 55 56 56 OwnPtr<WebCore::GraphicsLayer> m_rootLayer; 57 RetainPtr<PlatformLayer> m_fullScreenRootLayer;58 57 LayerTreeContext m_layerTreeContext; 59 58 RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient; -
trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm
r86588 r86738 132 132 void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* layer) 133 133 { 134 if ( m_fullScreenRootLayer == (layer ? layer->platformLayer() : 0))134 if ((!m_rootLayer || m_rootLayer->children().isEmpty()) && !layer) 135 135 return; 136 136 137 137 if (!layer) { 138 138 m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); 139 [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_rootLayer->platformLayer() userInfo:nil]; 139 140 if (m_rootLayer) { 140 141 m_rootLayer->removeAllChildren(); 141 142 m_rootLayer = nullptr; 142 143 } 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 149 151 if (!m_rootLayer) { 150 152 mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort(); … … 166 168 m_rootLayer->removeAllChildren(); 167 169 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]; 175 173 } 176 174 … … 179 177 ASSERT(m_element); 180 178 181 if (!m_ fullScreenRootLayer) {179 if (!m_rootLayer || m_rootLayer->children().isEmpty()) { 182 180 // If we don't have a root layer, we can't animate in and out of full screen 183 181 this->beganEnterFullScreenAnimation(); … … 188 186 IntRect destinationFrame = getFullScreenRect(); 189 187 m_element->document()->setFullScreenRendererSize(destinationFrame.size()); 190 m_rootLayer->syncCompositingStateForThisLayerOnly(); 191 m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); 188 m_rootLayer->syncCompositingState(); 192 189 193 190 // FIXME: Once we gain the ability to do native WebKit animations of generated 194 191 // content, this can change to use them. Meanwhile, we'll have to animate the 195 192 // CALayer directly: 196 CALayer* caLayer = m_ fullScreenRootLayer.get();193 CALayer* caLayer = m_rootLayer->children().first()->platformLayer(); 197 194 198 195 // Create a transformation matrix that will transform the renderer layer such that … … 234 231 ASSERT(m_element); 235 232 236 if (!m_ fullScreenRootLayer) {233 if (!m_rootLayer || m_rootLayer->children().isEmpty()) { 237 234 // If we don't have a root layer, we can't animate in and out of full screen 238 235 this->beganExitFullScreenAnimation(); … … 243 240 IntRect destinationFrame = getFullScreenRect(); 244 241 m_element->document()->setFullScreenRendererSize(destinationFrame.size()); 245 m_rootLayer->syncCompositingStateForThisLayerOnly(); 246 m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); 242 m_rootLayer->syncCompositingState(); 247 243 248 244 // FIXME: Once we gain the ability to do native WebKit animations of generated 249 245 // content, this can change to use them. Meanwhile, we'll have to animate the 250 246 // 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; 252 249 253 250 // Create a transformation matrix that will transform the renderer layer such that 254 251 // the fullscreen element appears to move from its starting position and size to its 255 252 // 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]; 258 255 CGPoint layerAnchor = [caLayer anchorPoint]; 259 256 CGPoint initialPosition = CGPointMake( … … 269 266 CATransform3D finalTransform = CATransform3DConcat(shrinkTransform, shiftTransform); 270 267 271 CATransform3D initialTransform = [ (CALayer*)[caLayer presentationLayer]transform];268 CATransform3D initialTransform = [presentationLayer transform]; 272 269 273 270 // 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.