Changeset 86186 in webkit


Ignore:
Timestamp:
May 10, 2011 3:43:29 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

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

Reviewed by Darin Adler.

WebKit2: Cancelling full screen before animation completes leads to full screen window staying up.
https://bugs.webkit.org/show_bug.cgi?id=60531

Remove the (unused) _isAnimating ivar and replace it with two ivars: _isEnteringFullScreen and
_isExitingFullScreen. These will ensure each is only called once per full screen request, and
that if one exit/enter request interrupts another, that the required functions are called in
order.

  • UIProcess/mac/WKFullScreenWindowController.h:
  • UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): Removed _isAnimating. (-[WKFullScreenWindowController exitFullScreen]): Ditto. (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Gate on _isEnteringFullScreen. Check _isExitingFullScreen

and call [self finishedExitFullScreenAnimation:] if necessary.

(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Gate on _isEnteringFullScreen.
(-[WKFullScreenWindowController beganExitFullScreenAnimation]): Gate on _isExitingFullScreen. Check _isEnteringFullScreen

and call [self finishedEnterFullScreenAnimation:] if necessary.

(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Gate on _isExitingFullScreen.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r86184 r86186  
     12011-05-09  Jeremy Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKit2: Cancelling full screen before animation completes leads to full screen window staying up.
     6        https://bugs.webkit.org/show_bug.cgi?id=60531
     7
     8        Remove the (unused) _isAnimating ivar and replace it with two ivars: _isEnteringFullScreen and
     9        _isExitingFullScreen.  These will ensure each is only called once per full screen request, and
     10        that if one exit/enter request interrupts another, that the required functions are called in
     11        order.
     12
     13        * UIProcess/mac/WKFullScreenWindowController.h:
     14        * UIProcess/mac/WKFullScreenWindowController.mm:
     15        (-[WKFullScreenWindowController enterFullScreen:]): Removed _isAnimating.
     16        (-[WKFullScreenWindowController exitFullScreen]): Ditto.
     17        (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Gate on _isEnteringFullScreen. Check _isExitingFullScreen
     18            and call [self finishedExitFullScreenAnimation:] if necessary.
     19        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Gate on _isEnteringFullScreen.
     20        (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Gate on _isExitingFullScreen. Check _isEnteringFullScreen
     21            and call [self finishedEnterFullScreenAnimation:] if necessary.
     22        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Gate on _isExitingFullScreen.
     23
    1242011-05-10  Beth Dakin  <bdakin@apple.com>
    225
  • trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h

    r80923 r86186  
    4646    RetainPtr<NSView> _layerHostingView;
    4747   
    48     BOOL _isAnimating;
     48    BOOL _isEnteringFullScreen;
     49    BOOL _isExitingFullScreen;
    4950    BOOL _isFullScreen;
    5051    BOOL _isWindowLoaded;
  • trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

    r86107 r86186  
    177177   
    178178    _isFullScreen = YES;
    179     _isAnimating = YES;
    180179   
    181180    NSDisableScreenUpdates();
     
    209208
    210209- (void)beganEnterFullScreenAnimation
    211 {   
     210{
     211    if (_isEnteringFullScreen)
     212        return;
     213    _isEnteringFullScreen = YES;
     214
     215    if (_isExitingFullScreen)
     216        [self finishedExitFullScreenAnimation:NO];
     217
    212218    [self _updateMenuAndDockForFullScreen];   
    213219    [self _updatePowerAssertions];
     
    229235
    230236    NSEnableScreenUpdates();
    231     _isAnimating = YES;
    232237}
    233238
    234239- (void)finishedEnterFullScreenAnimation:(bool)completed
    235240{
     241    if (!_isEnteringFullScreen)
     242        return;
     243    _isEnteringFullScreen = NO;
     244
    236245    NSDisableScreenUpdates();
    237246   
     
    268277    [self _manager]->didEnterFullScreen();
    269278    NSEnableScreenUpdates();
    270    
    271     _isAnimating = NO;
    272279}
    273280
     
    278285   
    279286    _isFullScreen = NO;
    280     _isAnimating = YES;
    281287   
    282288    NSDisableScreenUpdates();
     
    287293
    288294- (void)beganExitFullScreenAnimation
    289 {   
     295{
     296    if (_isExitingFullScreen)
     297        return;
     298    _isExitingFullScreen = YES;
     299
     300    if (_isEnteringFullScreen)
     301        [self finishedExitFullScreenAnimation:NO];
     302
    290303    [self _updateMenuAndDockForFullScreen];   
    291304    [self _updatePowerAssertions];
     
    318331   
    319332    NSEnableScreenUpdates();
    320     _isAnimating = YES;
    321333}
    322334
    323335- (void)finishedExitFullScreenAnimation:(bool)completed
    324336{
     337    if (!_isExitingFullScreen)
     338        return;
     339    _isExitingFullScreen = NO;
     340
    325341    NSDisableScreenUpdates();
    326342   
     
    335351   
    336352    [self _manager]->didExitFullScreen();
    337     NSEnableScreenUpdates();
    338    
    339     _isAnimating = NO;
     353    NSEnableScreenUpdates();   
    340354}
    341355
Note: See TracChangeset for help on using the changeset viewer.