Full-screen: Don't change the collectionBehavior of the WebView's NSWindow if not...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2011 21:38:05 +0000 (21:38 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2011 21:38:05 +0000 (21:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=63217
<rdar://problem/9660291>

Reviewed by Darin Adler.

Check to see if the NSWindow hosting the WebView is not on the active space before changing the window's
collectionBehavior.

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

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

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

index a67bba3..d2a5937 100644 (file)
@@ -1,3 +1,17 @@
+2011-06-22  Jer Noble  <jer.noble@apple.com>
+
+        Full-screen: Don't change the collectionBehavior of the WebView's NSWindow if not necessary
+        https://bugs.webkit.org/show_bug.cgi?id=63217
+        <rdar://problem/9660291>
+
+        Reviewed by Darin Adler.
+
+        Check to see if the NSWindow hosting the WebView is not on the active space before changing the window's
+        collectionBehavior.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController beganExitFullScreenAnimation]):
+
 2011-07-12  Andreas Kling  <kling@webkit.org>
 
         [Qt][WK2] Navigation actions in incorrect state when loadStarted() is emitted.
index f0caf15..eff9622 100644 (file)
@@ -325,12 +325,16 @@ using namespace WebCore;
         NSWindowAnimationBehavior animationBehavior = [webWindow animationBehavior];
         [webWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
 #endif
-        // The user may have moved the fullScreen window in Spaces, so temporarily change 
-        // the collectionBehavior of the webView's window:
-        NSWindowCollectionBehavior behavior = [webWindow collectionBehavior];
-        [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
-        [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
-        [webWindow setCollectionBehavior:behavior];
+        // If the user has moved the fullScreen window into a new space, temporarily change
+        // the collectionBehavior of the webView's window so that it is pulled into the active space:
+        if (![webWindow isOnActiveSpace]) {
+            NSWindowCollectionBehavior behavior = [webWindow collectionBehavior];
+            [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
+            [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
+            [webWindow setCollectionBehavior:behavior];
+        } else
+            [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
+
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
         [webWindow setAnimationBehavior:animationBehavior];
 #endif