{"action":"created","comment":{"url":"https://api.github.com/repos/mawie81/electron-window-state/pulls/comments/81509669","pull_request_review_id":2484194,"id":81509669,"diff_hunk":"@@ -36,12 +36,37 @@ module.exports = function (options) {\n \n   function validateState() {\n     var isValid = state && (hasBounds() || state.isMaximized || state.isFullScreen);\n+    if (!isValid) {\n+      state = null;\n+      return;\n+    }\n+\n     if (hasBounds() && state.displayBounds) {\n       // Check if the display where the window was last open is still available\n       var displayBounds = screen.getDisplayMatching(state).bounds;\n-      isValid = deepEqual(state.displayBounds, displayBounds, {strict: true});\n+      var sameBounds = deepEqual(state.displayBounds, displayBounds, {strict: true});\n+      if (!sameBounds) {\n+        if (displayBounds.width < state.displayBounds) {","path":"index.js","position":15,"original_position":15,"commit_id":"01d7667f40a7505e421aac9c5cbba2bbdb236178","original_commit_id":"01d7667f40a7505e421aac9c5cbba2bbdb236178","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},"body":"Shouldn´t this be ```state.displayBounds.width```?","created_at":"2016-10-03T08:37:07Z","updated_at":"2016-10-03T08:46:22Z","html_url":"https://github.com/mawie81/electron-window-state/pull/12#discussion_r81509669","pull_request_url":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/mawie81/electron-window-state/pulls/comments/81509669"},"html":{"href":"https://github.com/mawie81/electron-window-state/pull/12#discussion_r81509669"},"pull_request":{"href":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12","id":87552551,"html_url":"https://github.com/mawie81/electron-window-state/pull/12","diff_url":"https://github.com/mawie81/electron-window-state/pull/12.diff","patch_url":"https://github.com/mawie81/electron-window-state/pull/12.patch","issue_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/12","number":12,"state":"open","locked":false,"title":"Try to keep as state as possible when the display changes","user":{"login":"joshaber","id":13760,"avatar_url":"https://avatars.githubusercontent.com/u/13760?v=3","gravatar_id":"","url":"https://api.github.com/users/joshaber","html_url":"https://github.com/joshaber","followers_url":"https://api.github.com/users/joshaber/followers","following_url":"https://api.github.com/users/joshaber/following{/other_user}","gists_url":"https://api.github.com/users/joshaber/gists{/gist_id}","starred_url":"https://api.github.com/users/joshaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshaber/subscriptions","organizations_url":"https://api.github.com/users/joshaber/orgs","repos_url":"https://api.github.com/users/joshaber/repos","events_url":"https://api.github.com/users/joshaber/events{/privacy}","received_events_url":"https://api.github.com/users/joshaber/received_events","type":"User","site_admin":true},"body":"👋 \r\n\r\nIf the user launches the app on a different screen, try to keep all their state if possible, clamping it as needed.\r\n\r\nOtherwise the app keeps resetting the window state without any real need.","created_at":"2016-09-30T19:30:05Z","updated_at":"2016-10-03T08:46:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"655b36b1d64454e55276301e8aad6cac0bde17ea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12/commits","review_comments_url":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12/comments","review_comment_url":"https://api.github.com/repos/mawie81/electron-window-state/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/12/comments","statuses_url":"https://api.github.com/repos/mawie81/electron-window-state/statuses/01d7667f40a7505e421aac9c5cbba2bbdb236178","head":{"label":"joshaber:fix-monitor-switching","ref":"fix-monitor-switching","sha":"01d7667f40a7505e421aac9c5cbba2bbdb236178","user":{"login":"joshaber","id":13760,"avatar_url":"https://avatars.githubusercontent.com/u/13760?v=3","gravatar_id":"","url":"https://api.github.com/users/joshaber","html_url":"https://github.com/joshaber","followers_url":"https://api.github.com/users/joshaber/followers","following_url":"https://api.github.com/users/joshaber/following{/other_user}","gists_url":"https://api.github.com/users/joshaber/gists{/gist_id}","starred_url":"https://api.github.com/users/joshaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshaber/subscriptions","organizations_url":"https://api.github.com/users/joshaber/orgs","repos_url":"https://api.github.com/users/joshaber/repos","events_url":"https://api.github.com/users/joshaber/events{/privacy}","received_events_url":"https://api.github.com/users/joshaber/received_events","type":"User","site_admin":true},"repo":{"id":69693188,"name":"electron-window-state","full_name":"joshaber/electron-window-state","owner":{"login":"joshaber","id":13760,"avatar_url":"https://avatars.githubusercontent.com/u/13760?v=3","gravatar_id":"","url":"https://api.github.com/users/joshaber","html_url":"https://github.com/joshaber","followers_url":"https://api.github.com/users/joshaber/followers","following_url":"https://api.github.com/users/joshaber/following{/other_user}","gists_url":"https://api.github.com/users/joshaber/gists{/gist_id}","starred_url":"https://api.github.com/users/joshaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshaber/subscriptions","organizations_url":"https://api.github.com/users/joshaber/orgs","repos_url":"https://api.github.com/users/joshaber/repos","events_url":"https://api.github.com/users/joshaber/events{/privacy}","received_events_url":"https://api.github.com/users/joshaber/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/joshaber/electron-window-state","description":"A library to store and restore window sizes and positions for your Electron app","fork":true,"url":"https://api.github.com/repos/joshaber/electron-window-state","forks_url":"https://api.github.com/repos/joshaber/electron-window-state/forks","keys_url":"https://api.github.com/repos/joshaber/electron-window-state/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshaber/electron-window-state/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshaber/electron-window-state/teams","hooks_url":"https://api.github.com/repos/joshaber/electron-window-state/hooks","issue_events_url":"https://api.github.com/repos/joshaber/electron-window-state/issues/events{/number}","events_url":"https://api.github.com/repos/joshaber/electron-window-state/events","assignees_url":"https://api.github.com/repos/joshaber/electron-window-state/assignees{/user}","branches_url":"https://api.github.com/repos/joshaber/electron-window-state/branches{/branch}","tags_url":"https://api.github.com/repos/joshaber/electron-window-state/tags","blobs_url":"https://api.github.com/repos/joshaber/electron-window-state/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshaber/electron-window-state/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshaber/electron-window-state/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshaber/electron-window-state/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshaber/electron-window-state/statuses/{sha}","languages_url":"https://api.github.com/repos/joshaber/electron-window-state/languages","stargazers_url":"https://api.github.com/repos/joshaber/electron-window-state/stargazers","contributors_url":"https://api.github.com/repos/joshaber/electron-window-state/contributors","subscribers_url":"https://api.github.com/repos/joshaber/electron-window-state/subscribers","subscription_url":"https://api.github.com/repos/joshaber/electron-window-state/subscription","commits_url":"https://api.github.com/repos/joshaber/electron-window-state/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshaber/electron-window-state/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshaber/electron-window-state/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshaber/electron-window-state/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshaber/electron-window-state/contents/{+path}","compare_url":"https://api.github.com/repos/joshaber/electron-window-state/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshaber/electron-window-state/merges","archive_url":"https://api.github.com/repos/joshaber/electron-window-state/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshaber/electron-window-state/downloads","issues_url":"https://api.github.com/repos/joshaber/electron-window-state/issues{/number}","pulls_url":"https://api.github.com/repos/joshaber/electron-window-state/pulls{/number}","milestones_url":"https://api.github.com/repos/joshaber/electron-window-state/milestones{/number}","notifications_url":"https://api.github.com/repos/joshaber/electron-window-state/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshaber/electron-window-state/labels{/name}","releases_url":"https://api.github.com/repos/joshaber/electron-window-state/releases{/id}","deployments_url":"https://api.github.com/repos/joshaber/electron-window-state/deployments","created_at":"2016-09-30T18:49:37Z","updated_at":"2016-09-30T18:49:39Z","pushed_at":"2016-09-30T19:30:05Z","git_url":"git://github.com/joshaber/electron-window-state.git","ssh_url":"git@github.com:joshaber/electron-window-state.git","clone_url":"https://github.com/joshaber/electron-window-state.git","svn_url":"https://github.com/joshaber/electron-window-state","homepage":"","size":22,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mawie81:master","ref":"master","sha":"b6e8ea5bd213999639c25af8ca81e0971dcd9d03","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},"repo":{"id":45307461,"name":"electron-window-state","full_name":"mawie81/electron-window-state","owner":{"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},"private":false,"html_url":"https://github.com/mawie81/electron-window-state","description":"A library to store and restore window sizes and positions for your Electron app","fork":false,"url":"https://api.github.com/repos/mawie81/electron-window-state","forks_url":"https://api.github.com/repos/mawie81/electron-window-state/forks","keys_url":"https://api.github.com/repos/mawie81/electron-window-state/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mawie81/electron-window-state/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mawie81/electron-window-state/teams","hooks_url":"https://api.github.com/repos/mawie81/electron-window-state/hooks","issue_events_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/events{/number}","events_url":"https://api.github.com/repos/mawie81/electron-window-state/events","assignees_url":"https://api.github.com/repos/mawie81/electron-window-state/assignees{/user}","branches_url":"https://api.github.com/repos/mawie81/electron-window-state/branches{/branch}","tags_url":"https://api.github.com/repos/mawie81/electron-window-state/tags","blobs_url":"https://api.github.com/repos/mawie81/electron-window-state/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mawie81/electron-window-state/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mawie81/electron-window-state/git/refs{/sha}","trees_url":"https://api.github.com/repos/mawie81/electron-window-state/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mawie81/electron-window-state/statuses/{sha}","languages_url":"https://api.github.com/repos/mawie81/electron-window-state/languages","stargazers_url":"https://api.github.com/repos/mawie81/electron-window-state/stargazers","contributors_url":"https://api.github.com/repos/mawie81/electron-window-state/contributors","subscribers_url":"https://api.github.com/repos/mawie81/electron-window-state/subscribers","subscription_url":"https://api.github.com/repos/mawie81/electron-window-state/subscription","commits_url":"https://api.github.com/repos/mawie81/electron-window-state/commits{/sha}","git_commits_url":"https://api.github.com/repos/mawie81/electron-window-state/git/commits{/sha}","comments_url":"https://api.github.com/repos/mawie81/electron-window-state/comments{/number}","issue_comment_url":"https://api.github.com/repos/mawie81/electron-window-state/issues/comments{/number}","contents_url":"https://api.github.com/repos/mawie81/electron-window-state/contents/{+path}","compare_url":"https://api.github.com/repos/mawie81/electron-window-state/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mawie81/electron-window-state/merges","archive_url":"https://api.github.com/repos/mawie81/electron-window-state/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mawie81/electron-window-state/downloads","issues_url":"https://api.github.com/repos/mawie81/electron-window-state/issues{/number}","pulls_url":"https://api.github.com/repos/mawie81/electron-window-state/pulls{/number}","milestones_url":"https://api.github.com/repos/mawie81/electron-window-state/milestones{/number}","notifications_url":"https://api.github.com/repos/mawie81/electron-window-state/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mawie81/electron-window-state/labels{/name}","releases_url":"https://api.github.com/repos/mawie81/electron-window-state/releases{/id}","deployments_url":"https://api.github.com/repos/mawie81/electron-window-state/deployments","created_at":"2015-10-31T15:43:06Z","updated_at":"2016-09-28T06:08:01Z","pushed_at":"2016-09-30T19:30:05Z","git_url":"git://github.com/mawie81/electron-window-state.git","ssh_url":"git@github.com:mawie81/electron-window-state.git","clone_url":"https://github.com/mawie81/electron-window-state.git","svn_url":"https://github.com/mawie81/electron-window-state","homepage":"","size":22,"stargazers_count":103,"watchers_count":103,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":4,"forks":9,"open_issues":4,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12"},"html":{"href":"https://github.com/mawie81/electron-window-state/pull/12"},"issue":{"href":"https://api.github.com/repos/mawie81/electron-window-state/issues/12"},"comments":{"href":"https://api.github.com/repos/mawie81/electron-window-state/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/mawie81/electron-window-state/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mawie81/electron-window-state/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/mawie81/electron-window-state/statuses/01d7667f40a7505e421aac9c5cbba2bbdb236178"}}}}
{"actor":{"display_login":"mawie81"}}