• Leonard Grey's avatar
    Mac: ensure modals report correct content rect · 23ab3627
    Leonard Grey authored
    Modal sheets use "NSTitleWindowStyleMask" for Reasons (looks like mostly
    input handling). This means that when we ask for their content rect, they
    account for the title bar, though we don't actually display one!
    
    In practice this means:
    1. We've been undersizing modals for a while.
    2. If it so happens that if we roundtrip back through NativeWidgetNSWindowBridge::SetBounds
    (motivating example: when the window is moved to a screen with different DPI), we lose
    *another* title bar's worth of height.
    
    This change modifies the style mask so that the title bar isn't accounted for when
    calculating the content rect.
    
    Bug: 982477
    Change-Id: I79da0297a1d79eaae3f7eaef85a5986c12b74436
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721269
    Auto-Submit: Leonard Grey <lgrey@chromium.org>
    Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Commit-Queue: Leonard Grey <lgrey@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#681795}
    23ab3627
native_widget_mac_unittest.mm 94.3 KB