### 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

12.0.4

### What operating system are you using?

Other Linux

### Operating System Version

Fedora

### What arch are you using?

x64

### Last Known Working Electron version

11.4.3

### Expected Behavior

Events should fire for maximizing or unmaximizing a browserwindow.

### Actual Behavior

They don't, since the V12 release. It works fine in Electron 11 and below. See the fiddle console, it should log `max` and `unmax` when you toggle the maximization state, but it doesn't in Electron 12. One weird thing is, that when you maximize the window, and then go to fullscreen, it will emit `max`, but even when leaving fullscreen or unmaximizing the window, you will never see `unmax`. Not that fullscreen should have anything to do with the maximize event, but I noticed it does, so I thought I would mention that. You can see in the screenshot below that it only logs `max` (after going fullscreen), which shouldn't be possible if the events would fire correctly, as it should alternate `max`, `unmax`, `max` etc.
![image](https://user-images.githubusercontent.com/1696674/115083591-e75ab100-9f07-11eb-9334-5b65f80a0567.png)
And this is what happens in Electron 11.4.3:
![image](https://user-images.githubusercontent.com/1696674/115083718-1d983080-9f08-11eb-92af-ce8e6742b769.png)
When not entering fullscreen in V12, the logs remains empty, the ONLY way to make it trigger the `max` event is by maximizing and then going fullscreen, but it never triggers `unmax`.

### Testcase Gist URL

https://gist.github.com/Jelmerro/5a5a8b0cfcf69a24993b47bd7526d242
shell/browser/ui/x/window_state_watcher.h
#ifndef ELECTRON_SHELL_BROWSER_UI_X_WINDOW_STATE_WATCHER_H_
#define ELECTRON_SHELL_BROWSER_UI_X_WINDOW_STATE_WATCHER_H_
#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/gfx/x/event.h"
#include "shell/browser/native_window_views.h"
namespace electron {
class WindowStateWatcher : public x11::EventObserver {
 public:
  explicit WindowStateWatcher(NativeWindowViews* window);
  ~WindowStateWatcher() override;
  
  WindowStateWatcher(const WindowStateWatcher&) = delete;
  WindowStateWatcher& operator=(const WindowStateWatcher&) = delete;
 protected:
  
  void OnEvent(const x11::Event& x11_event) override;
 private:
  bool IsWindowStateEvent(const x11::Event& x11_event) const;
  NativeWindowViews* window_;
  gfx::AcceleratedWidget widget_;
  const x11::Atom net_wm_state_atom_;
  const x11::Atom net_wm_state_hidden_atom_;
  const x11::Atom net_wm_state_maximized_vert_atom_;
  const x11::Atom net_wm_state_maximized_horz_atom_;
  const x11::Atom net_wm_state_fullscreen_atom_;
};
}  
#endif