### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/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

14.0.0

### What operating system are you using?

macOS

### Operating System Version

macOS Big Sur 11.6

### What arch are you using?

x64

### Last Known Working Electron version

13.5.2

### Expected Behavior

When I set the `vibrancy` option on a new BrowserWindow (e.g. to "popover"), the window's background should reflect this.

<img width="838" alt="CleanShot 2021-10-18 at 22 25 54@2x" src="https://user-images.githubusercontent.com/541628/137801784-5ba70aba-40c0-4dec-a112-d770d7db24ec.png">
 

### Actual Behavior

The window's background stays white. Adding `transparent: true` to the options makes the background work as expected but removes the title bar.

<img width="820" alt="CleanShot 2021-10-18 at 22 26 48@2x" src="https://user-images.githubusercontent.com/541628/137801905-ad88db6f-2aa7-4f42-bb15-829eb2581fa4.png">

<img width="827" alt="CleanShot 2021-10-18 at 22 28 01@2x" src="https://user-images.githubusercontent.com/541628/137802078-0b7854fe-4de1-49d5-8d44-18cf78b3739a.png">


### Testcase Gist URL

https://gist.github.com/bbc333443f77ce4a6061d43eddf67fd4

### Additional Information

This might be related to #30993 
shell/browser/api/electron_api_browser_window.cc
if (api_web_contents_) {
    
    
    auto* host = web_contents()->GetRenderViewHost();
    if (host)
      host->GetWidget()->RemoveInputEventObserver(this);
    api_web_contents_->RemoveObserver(this);
    
    OnCloseContents();
  }
}
void BrowserWindow::OnInputEvent(const blink::WebInputEvent& event) {
  switch (event.GetType()) {
    case blink::WebInputEvent::Type::kGestureScrollBegin:
    case blink::WebInputEvent::Type::kGestureScrollUpdate:
    case blink::WebInputEvent::Type::kGestureScrollEnd:
      Emit("scroll-touch-edge");
      break;
    default:
      break;
  }
}
void BrowserWindow::RenderViewHostChanged(content::RenderViewHost* old_host,