Changeset 280976 in webkit


Ignore:
Timestamp:
Aug 12, 2021 12:16:04 PM (11 months ago)
Author:
jer.noble@apple.com
Message:

[macOS] Enter fullscreen animation interferes with auto-hiding menu bar
https://bugs.webkit.org/show_bug.cgi?id=229039
<rdar://79150656>

Reviewed by Eric Carlson.

Source/WebCore:

Add a new utility method to calculate the available screen rect taking menu bar
hiding into account.

  • platform/PlatformScreen.h:
  • platform/mac/PlatformScreenMac.mm:

(WebCore::screenRectAvoidingMenuBar):

Source/WebKit:

When entering fullscreen, if a user has unchecked the "auto-hide menu bar in fullscreen"
setting, the fullscreen animation will enter to the full screen frame, then snap down once
the animation completes to reveal the menu bar. Instead, use a WebCore utility method to
calculate the screen's frame taking that menu bar into account, and use it for the initial
enter fullscreen animation.

  • UIProcess/mac/WKFullScreenWindowController.mm:

(-[WKFullScreenWindowController enterFullScreen:]):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r280973 r280976  
     12021-08-12  Jer Noble  <jer.noble@apple.com>
     2
     3        [macOS] Enter fullscreen animation interferes with auto-hiding menu bar
     4        https://bugs.webkit.org/show_bug.cgi?id=229039
     5        <rdar://79150656>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Add a new utility method to calculate the available screen rect taking menu bar
     10        hiding into account.
     11
     12        * platform/PlatformScreen.h:
     13        * platform/mac/PlatformScreenMac.mm:
     14        (WebCore::screenRectAvoidingMenuBar):
     15
    1162021-08-12  Devin Rousso  <drousso@apple.com>
    217
  • trunk/Source/WebCore/platform/PlatformScreen.h

    r278340 r280976  
    118118FloatRect screenRectForDisplay(PlatformDisplayID);
    119119WEBCORE_EXPORT FloatRect screenRectForPrimaryScreen();
     120WEBCORE_EXPORT FloatRect availableScreenRect(NSScreen *);
    120121
    121122WEBCORE_EXPORT FloatRect toUserSpace(const NSRect&, NSWindow *destination);
     
    133134IORegistryGPUID gpuIDForDisplay(PlatformDisplayID);
    134135IORegistryGPUID gpuIDForDisplayMask(uint32_t);
     136
     137WEBCORE_EXPORT FloatRect screenRectAvoidingMenuBar(NSScreen *);
    135138
    136139#endif // !PLATFORM(MAC)
  • trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm

    r277986 r280976  
    4545#endif
    4646
     47#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/PlatformScreenIOS.mm>)
     48#import <WebKitAdditions/PlatformScreenMac.h>
     49#endif
     50
    4751namespace WebCore {
    4852
     
    416420}
    417421
     422#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/PlatformScreenIOS.mm>)
     423#import <WebKitAdditions/PlatformScreenMac.mm>
     424#else
     425FloatRect screenRectAvoidingMenuBar(NSScreen* screen)
     426{
     427    return screen.frame;
     428}
     429#endif
     430
     431
    418432} // namespace WebCore
    419433
  • trunk/Source/WebKit/ChangeLog

    r280973 r280976  
     12021-08-12  Jer Noble  <jer.noble@apple.com>
     2
     3        [macOS] Enter fullscreen animation interferes with auto-hiding menu bar
     4        https://bugs.webkit.org/show_bug.cgi?id=229039
     5        <rdar://79150656>
     6
     7        Reviewed by Eric Carlson.
     8
     9        When entering fullscreen, if a user has unchecked the "auto-hide menu bar in fullscreen"
     10        setting, the fullscreen animation will enter to the full screen frame, then snap down once
     11        the animation completes to reveal the menu bar. Instead, use a WebCore utility method to
     12        calculate the screen's frame taking that menu bar into account, and use it for the initial
     13        enter fullscreen animation.
     14
     15        * UIProcess/mac/WKFullScreenWindowController.mm:
     16        (-[WKFullScreenWindowController enterFullScreen:]):
     17
    1182021-08-12  Devin Rousso  <drousso@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm

    r280670 r280976  
    228228    if (!screen)
    229229        screen = [NSScreen mainScreen];
    230     NSRect screenFrame = [screen frame];
    231 
     230
     231    NSRect screenFrame = WebCore::screenRectAvoidingMenuBar(screen);
    232232    NSRect webViewFrame = convertRectToScreen([_webView window], [_webView convertRect:[_webView frame] toView:nil]);
    233233
Note: See TracChangeset for help on using the changeset viewer.