{"action":"created","issue":{"url":"https://api.github.com/repos/mawie81/electron-window-state/issues/3","repository_url":"https://api.github.com/repos/mawie81/electron-window-state","labels_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/3/comments","events_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/3/events","html_url":"https://github.com/mawie81/electron-window-state/issues/3","id":134082269,"number":3,"title":"Maximize window problem","user":{"login":"Sigmanor","id":7986067,"avatar_url":"https://avatars.githubusercontent.com/u/7986067?v=3","gravatar_id":"","url":"https://api.github.com/users/Sigmanor","html_url":"https://github.com/Sigmanor","followers_url":"https://api.github.com/users/Sigmanor/followers","following_url":"https://api.github.com/users/Sigmanor/following{/other_user}","gists_url":"https://api.github.com/users/Sigmanor/gists{/gist_id}","starred_url":"https://api.github.com/users/Sigmanor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sigmanor/subscriptions","organizations_url":"https://api.github.com/users/Sigmanor/orgs","repos_url":"https://api.github.com/users/Sigmanor/repos","events_url":"https://api.github.com/users/Sigmanor/events{/privacy}","received_events_url":"https://api.github.com/users/Sigmanor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-16T19:58:18Z","updated_at":"2016-02-18T16:26:57Z","closed_at":null,"body":"Hi! Im use your cool library, and together with this, I use this code:\r\n```\r\n\tmainWindow = new BrowserWindow({\r\n\t\tshow: false,\r\n\t});\r\n\r\n\tmainWindow.webContents.on('dom-ready', function() {\r\n\t\tmainWindow.show();\r\n\t});\r\n```\r\nin order to the contents of the window displayed only when fully loaded. When window is no maximized this working fine, but when app start maximized, this code does not work. Without your library all working as it should. Is there any solution?"},"comment":{"url":"https://api.github.com/repos/mawie81/electron-window-state/issues/comments/185801708","html_url":"https://github.com/mawie81/electron-window-state/issues/3#issuecomment-185801708","issue_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/3","id":185801708,"user":{"login":"mawie81","id":4981109,"avatar_url":"https://avatars.githubusercontent.com/u/4981109?v=3","gravatar_id":"","url":"https://api.github.com/users/mawie81","html_url":"https://github.com/mawie81","followers_url":"https://api.github.com/users/mawie81/followers","following_url":"https://api.github.com/users/mawie81/following{/other_user}","gists_url":"https://api.github.com/users/mawie81/gists{/gist_id}","starred_url":"https://api.github.com/users/mawie81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mawie81/subscriptions","organizations_url":"https://api.github.com/users/mawie81/orgs","repos_url":"https://api.github.com/users/mawie81/repos","events_url":"https://api.github.com/users/mawie81/events{/privacy}","received_events_url":"https://api.github.com/users/mawie81/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T16:26:57Z","updated_at":"2016-02-18T16:26:57Z","body":"I just learned that calling ```maximize()``` on the BrowserWindow also shows the window on Windows. On Mac it does not. This is even a reported bug in chromium https://code.google.com/p/chromium/issues/detail?id=452737 \r\n\r\nWhat I could try is to wait until the ```dom-ready```event to restore the maximized state but I´m not sure if this is a good solution. I´ll have to think about that.\r\n\r\nIn the meantime you could just opt-out of the restoration of the maximized state like this:\r\n\r\n````\r\nlet mainWindowState = windowStateKeeper({\r\n  defaultWidth: 1000,\r\n  defaultHeight: 800,\r\n  maximize: false\r\n});\r\n```\r\n\r\nAnd then restore it yourself if needed:\r\n\r\n```\r\nwindow.webContents.on('dom-ready', () => {\r\n  if (mainWindowState.isMaximized()) {\r\n   window.maximize();\r\n  }\r\n});\r\n```"}}