Title: [90851] trunk/Source/WebKit2
Revision
90851
Author
jer.no...@apple.com
Date
2011-07-12 14:38:05 -0700 (Tue, 12 Jul 2011)

Log Message

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

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (90850 => 90851)


--- trunk/Source/WebKit2/ChangeLog	2011-07-12 21:22:45 UTC (rev 90850)
+++ trunk/Source/WebKit2/ChangeLog	2011-07-12 21:38:05 UTC (rev 90851)
@@ -1,3 +1,17 @@
+2011-06-22  Jer Noble  <jer.no...@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  <kl...@webkit.org>
 
         [Qt][WK2] Navigation actions in incorrect state when loadStarted() is emitted.

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (90850 => 90851)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-07-12 21:22:45 UTC (rev 90850)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-07-12 21:38:05 UTC (rev 90851)
@@ -325,12 +325,16 @@
         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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to