### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

13.1.9

### What operating system are you using?

macOS

### Operating System Version

11.5.2

### What arch are you using?

x64

### Last Known Working Electron version

v13.0.0-nightly.20210129

### Expected Behavior

<img width="1680" alt="Screen Shot 2021-08-15 at 10 28 53 PM" src="https://user-images.githubusercontent.com/964386/129515418-58013fe8-3569-4192-a03e-ca49eb5a7730.png">


### Actual Behavior

<img width="1680" alt="Screen Shot 2021-08-15 at 10 28 12 PM" src="https://user-images.githubusercontent.com/964386/129515412-2e013c7b-a168-4ec1-b29b-3417b86aaf8c.png">


### Testcase Gist URL

https://gist.github.com/deepak1556/122174b84074ca7790f6ee30bd5578e2

### Additional Information

Regressed from https://github.com/electron/electron/pull/27489

/cc @zcbenz 
shell/browser/ui/cocoa/window_buttons_proxy.h
@interface WindowButtonsProxy : NSObject {
 @private
  NSWindow* window_;
  
  NSView* titlebar_container_;
  
  NSButton* left_;
  NSButton* right_;
  NSButton* middle_;
  
  gfx::Point margin_;
  
  gfx::Point default_margin_;
  
  BOOL show_on_hover_;
  BOOL mouse_inside_;
  base::scoped_nsobject<NSTrackingArea> tracking_area_;
  base::scoped_nsobject<ButtonsAreaHoverView> hover_view_;
}
- (id)initWithWindow:(NSWindow*)window;
- (void)setVisible:(BOOL)visible;
- (BOOL)isVisible;
- (void)setShowOnHover:(BOOL)yes;
- (void)setMargin:(const absl::optional<gfx::Point>&)margin;
- (NSRect)getButtonsContainerBounds;
- (void)redraw;
- (void)updateTrackingAreas;
@end
#endif