### 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 for an issue that matches the one I want to file, with only a solution not working https://github.com/electron/electron/issues/11756.

### Issue Details

* **Electron Version:**
  * 7.1.14
* **Operating System:**
  * macOS 10.15.2

### Expected Behavior
`maximizable` property should always work.

### Actual Behavior
`maximizable` property will be ignored when some other properties are changed to the window or an alert is shown.

### To Reproduce

1.

From https://github.com/electron/electron/issues/11756.
> If i create a window like this:
> 
> ```javascript
> win = new BrowserWindow({ title: "My App", backgroundColor:'#FF0000', maximizable:false, width: 400, height: 200, resizable: false})
> ```
> 
> The window maximize button get disabled as wanted, but if we active the alert function inside
> 
> the index.html file by putting `<script> alert("test"); </script>` inside the file then the maximize button get enabled again and we can use it again.

2.
Also, for other kinds of code, like
```javascript
var mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    maximizable: false,
    webPreferences: {
      nodeIntegration: true
    }
  })

nativeTheme.on('updated', function theThemeHasChanged() {
    if (nativeTheme.shouldUseDarkColors) {
      if (mainWindow != null) {
        mainWindow.setBackgroundColor('#393939');
      }
    } else {
      if (mainWindow != null) {
        mainWindow.setBackgroundColor('#fefefe');
      }
    }
  })
```
can also produce this problem.
(how to: set dark mode / light mode, and then maximizable property is ignored.)

### Additional Information

These are *extremely old* resources that I found:

- https://github.com/electron/electron/pull/6736
- https://github.com/electron/electron/pull/18425


shell/browser/native_window_mac.h
#ifndef SHELL_BROWSER_NATIVE_WINDOW_MAC_H_
#define SHELL_BROWSER_NATIVE_WINDOW_MAC_H_
#import <Cocoa/Cocoa.h>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
#include "base/mac/scoped_nsobject.h"
#include "shell/browser/native_window.h"
#include "ui/native_theme/native_theme_observer.h"
#include "ui/views/controls/native/native_view_host.h"
@class ElectronNSWindow;
@class ElectronNSWindowDelegate;
@class ElectronPreviewItem;
@class ElectronTouchBar;
@class CustomWindowButtonView;
namespace electron {
class RootViewMac;