Skip to content

Commit

Permalink
Cherry-pick c73791d. rdar://125734832
Browse files Browse the repository at this point in the history
    [visionOS] After exiting docked fullscreen, element fullscreen window contains only a view snapshot
    https://bugs.webkit.org/show_bug.cgi?id=272114
    rdar://125734832

    Reviewed by Jer Noble.

    Element fullscreen expects to exit when switching to LinearMediaPlayer fullscreen, but we lack the
    API from LinearMediaKit to do this properly. As a result, when exiting LinearMediaKit fullscreen the
    element fullscreen window remains visible with a view snapshot displayed in place of the web view.
    Work around this issue by exiting element fullscreen when we receive a video receiver endpoint.

    * Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
    (WebKit::PlaybackSessionManagerProxy::setVideoReceiverEndpoint):

    Canonical link: https://commits.webkit.org/277031@main
  • Loading branch information
aestes authored and Mohsin Qureshi committed Apr 3, 2024
1 parent b4346af commit faf827f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#import "PlaybackSessionManagerMessages.h"
#import "PlaybackSessionManagerProxyMessages.h"
#import "VideoReceiverEndpointMessage.h"
#import "WebFullScreenManagerProxy.h"
#import "WebPageProxy.h"
#import "WebProcessPool.h"
#import "WebProcessProxy.h"
Expand Down Expand Up @@ -775,6 +776,14 @@
if (!xpcConnection)
return;

// FIXME 125816935: element fullscreen is expected to exit when switching to LinearMediaPlayer
// fullscreen, but in order to do so in a way that's not visible to the user we need an API
// from LinearMediaKit to know when its scene swap transition has occurred. For now we just
// exit element fullscreen when we receive the video receiver endpoint, but this causes the
// element fullscreen window to close before the LinearMediaKit scene is visible.
if (endpoint && m_page->fullScreenManager() && m_page->fullScreenManager()->isFullScreen())
m_page->fullScreenManager()->requestExitFullScreen();

VideoReceiverEndpointMessage endpointMessage(WTFMove(processIdentifier), WTFMove(playerIdentifier), endpoint);
xpc_connection_send_message(xpcConnection.get(), endpointMessage.encode().get());
#else
Expand Down

0 comments on commit faf827f

Please sign in to comment.