Bug 230024 - [macOS] -[WKFullScreenWindowController exitFullScreenImmediately] does not exit fullscreen immediately
Summary: [macOS] -[WKFullScreenWindowController exitFullScreenImmediately] does not ex...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-07 15:17 PDT by Peng Liu
Modified: 2021-09-08 15:03 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.87 KB, patch)
2021-09-07 15:51 PDT, Peng Liu
jer.noble: review+
Details | Formatted Diff | Diff
Revise the patch based on Jer's comments (7.42 KB, patch)
2021-09-08 11:37 PDT, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2021-09-07 15:17:47 PDT
[macOS] -[WKFullScreenWindowController exitFullScreenImmediately] does not exit fullscreen immediately
Comment 1 Peng Liu 2021-09-07 15:51:51 PDT
Created attachment 437566 [details]
Patch
Comment 2 Peng Liu 2021-09-07 15:53:04 PDT
<rdar://82526303>
Comment 3 Jer Noble 2021-09-08 10:39:06 PDT
Comment on attachment 437566 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437566&action=review

LGTM. I'd take this opportunity to rename -finishedExitFullScreenAnimation: to something that says what the parameter is, like -finishedExitFullScreenAnimationAndExitImmediately:(BOOL)immediately.

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:572
> +    if (immediately)
> +        [self completeFinishExitFullScreenAnimationAfterRepaint];
> +    else {
> +        _page->forceRepaint([weakSelf = WeakObjCPtr<WKFullScreenWindowController>(self)] {
> +            [weakSelf completeFinishExitFullScreenAnimationAfterRepaint];
> +        });
> +    }

Nit: I'd have an early return here, rather than an else.
Comment 4 Peng Liu 2021-09-08 11:37:23 PDT
Created attachment 437651 [details]
Revise the patch based on Jer's comments
Comment 5 Peng Liu 2021-09-08 11:40:02 PDT
(In reply to Jer Noble from comment #3)
> Comment on attachment 437566 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437566&action=review
> 
> LGTM. I'd take this opportunity to rename -finishedExitFullScreenAnimation:
> to something that says what the parameter is, like
> -finishedExitFullScreenAnimationAndExitImmediately:(BOOL)immediately.

Good idea! Fixed.

> 
> > Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:572
> > +    if (immediately)
> > +        [self completeFinishExitFullScreenAnimationAfterRepaint];
> > +    else {
> > +        _page->forceRepaint([weakSelf = WeakObjCPtr<WKFullScreenWindowController>(self)] {
> > +            [weakSelf completeFinishExitFullScreenAnimationAfterRepaint];
> > +        });
> > +    }
> 
> Nit: I'd have an early return here, rather than an else.
Fixed.

I also renamed `completeFinishExitFullScreenAnimationAfterRepaint` to `completeFinishExitFullScreenAnimation` because it is not always called "after repaint".
Comment 6 EWS 2021-09-08 15:03:39 PDT
Committed r282175 (241467@main): <https://commits.webkit.org/241467@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437651 [details].