Entering full-screen video playback mode can get locked to the original space used by the application. Instead, we should make sure our full screen window is part of the current space before entering full screen mode.
<rdar://problem/17542310>
The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen mode. Subsequent fullscreen transitions will always start from this Space, even if you move the WebKit-hosted application to a different Space. We can help the display system know when we've moved to a new Space by calling NSWindow's "orderBack" method on the fullscreen window prior to starting the transition to fullscreen mode. This method call hooks the window into the current Space so everything works properly.
Created attachment 235085 [details] Patch
Comment on attachment 235085 [details] Patch If we orderBack, will the fullscreen animation be occluded in some way by front-more windows? Why not orderWindow:relativeTo: the WebView's window?
(or orderFront)
(In reply to comment #4) > (From update of attachment 235085 [details]) > If we orderBack, will the fullscreen animation be occluded in some way by front-more windows? Why not orderWindow:relativeTo: the WebView's window? We actually still do makeKeyAndOrderFront: as soon as the animation begins. So this just orders the window on screen slightly earlier.
(In reply to comment #6) > (In reply to comment #4) > > (From update of attachment 235085 [details] [details]) > > If we orderBack, will the fullscreen animation be occluded in some way by front-more windows? Why not orderWindow:relativeTo: the WebView's window? > > We actually still do makeKeyAndOrderFront: as soon as the animation begins. So this just orders the window on screen slightly earlier. Right. We are just trying to get the Window tied to the right Space when we are prepping to begin the animation. If we do it too late, the animation is tied to the wrong Space and we get bad behavior. "orderBack" avoids any weird flashing of the fullscreen Window before we are ready for it to be seen.
Comment on attachment 235085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=235085&action=review > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:270 > + [self.window orderBack: self]; // Make sure the full screen window is part of the correct Space Nit: .
Committed r171197: <http://trac.webkit.org/changeset/171197>
Comment on attachment 235085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=235085&action=review >> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:270 >> + [self.window orderBack: self]; // Make sure the full screen window is part of the correct Space > > Nit: . No space after the colon.