Bug 135020 - [Mac] Full screen video not always animating in the correct Space
Summary: [Mac] Full screen video not always animating in the correct Space
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-17 12:37 PDT by Brent Fulgham
Modified: 2014-07-17 20:29 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.00 KB, patch)
2014-07-17 12:48 PDT, Brent Fulgham
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2014-07-17 12:37:13 PDT
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.
Comment 1 Brent Fulgham 2014-07-17 12:42:20 PDT
<rdar://problem/17542310>
Comment 2 Brent Fulgham 2014-07-17 12:47:14 PDT
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.
Comment 3 Brent Fulgham 2014-07-17 12:48:24 PDT
Created attachment 235085 [details]
Patch
Comment 4 Geoffrey Garen 2014-07-17 13:25:44 PDT
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?
Comment 5 Geoffrey Garen 2014-07-17 13:26:06 PDT
(or orderFront)
Comment 6 Jer Noble 2014-07-17 13:54:22 PDT
(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.
Comment 7 Brent Fulgham 2014-07-17 14:07:02 PDT
(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 8 Dean Jackson 2014-07-17 14:14:31 PDT
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: .
Comment 9 Brent Fulgham 2014-07-17 14:28:19 PDT
Committed r171197: <http://trac.webkit.org/changeset/171197>
Comment 10 Darin Adler 2014-07-17 20:29:48 PDT
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.