[Mac] Exiting fullscreen via Mission Control leaves fullcreen window frontmost on...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2016 19:38:13 +0000 (19:38 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2016 19:38:13 +0000 (19:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152733

Reviewed by Eric Carlson.

Rather than ignore -windowDidExitFullScreen: notifications when fullscreen exit was
not initiated by WebKit (and the -window:startCustomAnimationToEnterFullScreenWithDuration:
method was not called), continue to exit fullscreen normally.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194593 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

index fb97879..e7b7fc9 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-05  Jer Noble  <jer.noble@apple.com>
+
+        [Mac] Exiting fullscreen via Mission Control leaves fullcreen window frontmost on desktop
+        https://bugs.webkit.org/show_bug.cgi?id=152733
+
+        Reviewed by Eric Carlson.
+
+        Rather than ignore -windowDidExitFullScreen: notifications when fullscreen exit was
+        not initiated by WebKit (and the -window:startCustomAnimationToEnterFullScreenWithDuration:
+        method was not called), continue to exit fullscreen normally.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
+
 2016-01-05  Alex Christensen  <achristensen@webkit.org>
 
         Clean up download code
index 240d610..63aadfb 100644 (file)
@@ -373,8 +373,15 @@ static const float minVideoWidth = 480 + 20 + 20; // Note: Keep in sync with med
 
 - (void)finishedExitFullScreenAnimation:(bool)completed
 {
-    if (_fullScreenState != ExitingFullScreen)
-        return;
+    if (_fullScreenState != ExitingFullScreen) {
+        // If we are not currently in the ExitingFullScreen state, this notification is unexpected, meaning
+        // fullscreen was exited without being initiated by WebKit. Do not return early, but continue to
+        // clean up our state by calling those methods which would have been called by -exitFullscreen,
+        // and proceed to close the fullscreen window.
+        [_webViewPlaceholder setTarget:nil];
+        [self _manager]->setAnimatingFullScreen(false);
+        [self _manager]->willExitFullScreen();
+    }
     _fullScreenState = NotInFullScreen;
 
     // Screen updates to be re-enabled in completeFinishExitFullScreenAnimationAfterRepaint.