connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10.01k stars 579 forks source link

not emit 'maximize' event when click 'maximize' button #66

Closed CharellKing closed 8 years ago

CharellKing commented 8 years ago

I create a 'browser-window'; it not emit 'maximize' event when I click 'maximize' button; To my surprised, these events('closed', 'minimize' etc) are ok.

this's my test code on max os x:

var main_window = new BrowserWindow({'accept-first-mouse': true, 'min-width': 500, 'min-height': 200, icon: tray_icon_path, 'title-bar-style': 'hidden', 'fullscreen': 'true'});
main_window.loadUrl(`file://${__dirname}/index.html`);

main_window.on('maximize', function() {
    console.log('maximize');
    main_window.maximize();
});
bibhas2 commented 8 years ago

This is not related to photonkit. You may want to open an issue with Electron.

In ay case, I gave it a try and it seems to work fine. You should not call main_window.maximize(); from the event handler. There's no need for it.

main_window.on('maximize', function() {
    console.log("I am maximized.");
  });

Also, console.log is printed on the terminal window and not in Chrome developer tool.