{"action":"created","comment":{"url":"https://api.github.com/repos/tomaka/winit/pulls/comments/192574712","pull_request_review_id":125381131,"id":192574712,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjU3NDcxMg==","diff_hunk":"@@ -150,6 +150,23 @@ impl MonitorId {\n     pub fn get_hidpi_factor(&self) -> f32 {\n         1.0\n     }\n+\n+    pub fn get_physical_extents(&self) -> Option<(u64, u64)> {\n+        unsafe {\n+            if setjmp(mem::transmute(&mut jmpbuf)) != 0 {\n+                let app: id = msg_send![Class::get(\"UIApplication\")?, sharedApplication];\n+                let delegate: id = msg_send![app, delegate];\n+                let state: *mut c_void = *(&*delegate).get_ivar(\"glutinState\");\n+                let state = state as *mut DelegateState;","path":"src/platform/ios/mod.rs","position":11,"original_position":11,"commit_id":"c2e030a6461f8e4b62f54fcb1cfd8329a1796f47","original_commit_id":"c2e030a6461f8e4b62f54fcb1cfd8329a1796f47","user":{"login":"francesca64","id":2096580,"node_id":"MDQ6VXNlcjIwOTY1ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/2096580?v=4","gravatar_id":"","url":"https://api.github.com/users/francesca64","html_url":"https://github.com/francesca64","followers_url":"https://api.github.com/users/francesca64/followers","following_url":"https://api.github.com/users/francesca64/following{/other_user}","gists_url":"https://api.github.com/users/francesca64/gists{/gist_id}","starred_url":"https://api.github.com/users/francesca64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francesca64/subscriptions","organizations_url":"https://api.github.com/users/francesca64/orgs","repos_url":"https://api.github.com/users/francesca64/repos","events_url":"https://api.github.com/users/francesca64/events{/privacy}","received_events_url":"https://api.github.com/users/francesca64/received_events","type":"User","site_admin":false},"body":"Okay, I've had a chance to work on iOS now. I don't believe this needs to be wrapped in `setjmp`, and you can just use `self.delegate_state` instead of re-retrieving everything.","created_at":"2018-06-03T01:39:55Z","updated_at":"2018-06-03T01:39:55Z","html_url":"https://github.com/tomaka/winit/pull/442#discussion_r192574712","pull_request_url":"https://api.github.com/repos/tomaka/winit/pulls/442","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/tomaka/winit/pulls/comments/192574712"},"html":{"href":"https://github.com/tomaka/winit/pull/442#discussion_r192574712"},"pull_request":{"href":"https://api.github.com/repos/tomaka/winit/pulls/442"}}},"pull_request":{"url":"https://api.github.com/repos/tomaka/winit/pulls/442","id":178721567,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc4NzIxNTY3","html_url":"https://github.com/tomaka/winit/pull/442","diff_url":"https://github.com/tomaka/winit/pull/442.diff","patch_url":"https://github.com/tomaka/winit/pull/442.patch","issue_url":"https://api.github.com/repos/tomaka/winit/issues/442","number":442,"state":"open","locked":false,"title":"Expose get_physical_extents for the MonitorId","user":{"login":"fschutt","id":12084016,"node_id":"MDQ6VXNlcjEyMDg0MDE2","avatar_url":"https://avatars1.githubusercontent.com/u/12084016?v=4","gravatar_id":"","url":"https://api.github.com/users/fschutt","html_url":"https://github.com/fschutt","followers_url":"https://api.github.com/users/fschutt/followers","following_url":"https://api.github.com/users/fschutt/following{/other_user}","gists_url":"https://api.github.com/users/fschutt/gists{/gist_id}","starred_url":"https://api.github.com/users/fschutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fschutt/subscriptions","organizations_url":"https://api.github.com/users/fschutt/orgs","repos_url":"https://api.github.com/users/fschutt/repos","events_url":"https://api.github.com/users/fschutt/events{/privacy}","received_events_url":"https://api.github.com/users/fschutt/received_events","type":"User","site_admin":false},"body":"At least on Windows, X11, Wayland, macOS and iOS, this new function returns the physical size of the screen in millimeter. On Android, I can't implement it because there is no way for me to the access to the JavaVM. This is waiting on https://github.com/tomaka/android-rs-glue/pull/116. I need this for two reasons:\r\n\r\n1. As a poor mans DPI value until proper DPI support is added - for rasterizing the font with freetype, I need the correct screen DPI - see: https://github.com/servo/webrender/issues/2596\r\n2. I am working on a GIS application where correct scaling is important - i.e. I have to know how large the physical monitor is so I can calculate the map scale accordingly. \r\n\r\nI haven't tested that the function actually returns the value in millimeter, though, just that it compiles.","created_at":"2018-04-01T09:34:25Z","updated_at":"2018-06-03T01:39:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f76755cefc545e8ac2a235095701ec6e12865982","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tomaka/winit/pulls/442/commits","review_comments_url":"https://api.github.com/repos/tomaka/winit/pulls/442/comments","review_comment_url":"https://api.github.com/repos/tomaka/winit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tomaka/winit/issues/442/comments","statuses_url":"https://api.github.com/repos/tomaka/winit/statuses/c2e030a6461f8e4b62f54fcb1cfd8329a1796f47","head":{"label":"fschutt:expose_dpi","ref":"expose_dpi","sha":"c2e030a6461f8e4b62f54fcb1cfd8329a1796f47","user":{"login":"fschutt","id":12084016,"node_id":"MDQ6VXNlcjEyMDg0MDE2","avatar_url":"https://avatars1.githubusercontent.com/u/12084016?v=4","gravatar_id":"","url":"https://api.github.com/users/fschutt","html_url":"https://github.com/fschutt","followers_url":"https://api.github.com/users/fschutt/followers","following_url":"https://api.github.com/users/fschutt/following{/other_user}","gists_url":"https://api.github.com/users/fschutt/gists{/gist_id}","starred_url":"https://api.github.com/users/fschutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fschutt/subscriptions","organizations_url":"https://api.github.com/users/fschutt/orgs","repos_url":"https://api.github.com/users/fschutt/repos","events_url":"https://api.github.com/users/fschutt/events{/privacy}","received_events_url":"https://api.github.com/users/fschutt/received_events","type":"User","site_admin":false},"repo":{"id":127554215,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc1NTQyMTU=","name":"winit","full_name":"fschutt/winit","owner":{"login":"fschutt","id":12084016,"node_id":"MDQ6VXNlcjEyMDg0MDE2","avatar_url":"https://avatars1.githubusercontent.com/u/12084016?v=4","gravatar_id":"","url":"https://api.github.com/users/fschutt","html_url":"https://github.com/fschutt","followers_url":"https://api.github.com/users/fschutt/followers","following_url":"https://api.github.com/users/fschutt/following{/other_user}","gists_url":"https://api.github.com/users/fschutt/gists{/gist_id}","starred_url":"https://api.github.com/users/fschutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fschutt/subscriptions","organizations_url":"https://api.github.com/users/fschutt/orgs","repos_url":"https://api.github.com/users/fschutt/repos","events_url":"https://api.github.com/users/fschutt/events{/privacy}","received_events_url":"https://api.github.com/users/fschutt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fschutt/winit","description":"is dependent upon by fschutt/glutin - note to self: do not delete","fork":true,"url":"https://api.github.com/repos/fschutt/winit","forks_url":"https://api.github.com/repos/fschutt/winit/forks","keys_url":"https://api.github.com/repos/fschutt/winit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fschutt/winit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fschutt/winit/teams","hooks_url":"https://api.github.com/repos/fschutt/winit/hooks","issue_events_url":"https://api.github.com/repos/fschutt/winit/issues/events{/number}","events_url":"https://api.github.com/repos/fschutt/winit/events","assignees_url":"https://api.github.com/repos/fschutt/winit/assignees{/user}","branches_url":"https://api.github.com/repos/fschutt/winit/branches{/branch}","tags_url":"https://api.github.com/repos/fschutt/winit/tags","blobs_url":"https://api.github.com/repos/fschutt/winit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fschutt/winit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fschutt/winit/git/refs{/sha}","trees_url":"https://api.github.com/repos/fschutt/winit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fschutt/winit/statuses/{sha}","languages_url":"https://api.github.com/repos/fschutt/winit/languages","stargazers_url":"https://api.github.com/repos/fschutt/winit/stargazers","contributors_url":"https://api.github.com/repos/fschutt/winit/contributors","subscribers_url":"https://api.github.com/repos/fschutt/winit/subscribers","subscription_url":"https://api.github.com/repos/fschutt/winit/subscription","commits_url":"https://api.github.com/repos/fschutt/winit/commits{/sha}","git_commits_url":"https://api.github.com/repos/fschutt/winit/git/commits{/sha}","comments_url":"https://api.github.com/repos/fschutt/winit/comments{/number}","issue_comment_url":"https://api.github.com/repos/fschutt/winit/issues/comments{/number}","contents_url":"https://api.github.com/repos/fschutt/winit/contents/{+path}","compare_url":"https://api.github.com/repos/fschutt/winit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fschutt/winit/merges","archive_url":"https://api.github.com/repos/fschutt/winit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fschutt/winit/downloads","issues_url":"https://api.github.com/repos/fschutt/winit/issues{/number}","pulls_url":"https://api.github.com/repos/fschutt/winit/pulls{/number}","milestones_url":"https://api.github.com/repos/fschutt/winit/milestones{/number}","notifications_url":"https://api.github.com/repos/fschutt/winit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fschutt/winit/labels{/name}","releases_url":"https://api.github.com/repos/fschutt/winit/releases{/id}","deployments_url":"https://api.github.com/repos/fschutt/winit/deployments","created_at":"2018-03-31T17:18:11Z","updated_at":"2018-04-01T10:29:14Z","pushed_at":"2018-05-09T18:55:48Z","git_url":"git://github.com/fschutt/winit.git","ssh_url":"git@github.com:fschutt/winit.git","clone_url":"https://github.com/fschutt/winit.git","svn_url":"https://github.com/fschutt/winit","homepage":"","size":6600,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tomaka:master","ref":"master","sha":"e48f1fc5f16be497f3ad18164ff96bdb3a31fa5b","user":{"login":"tomaka","id":1412254,"node_id":"MDQ6VXNlcjE0MTIyNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1412254?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaka","html_url":"https://github.com/tomaka","followers_url":"https://api.github.com/users/tomaka/followers","following_url":"https://api.github.com/users/tomaka/following{/other_user}","gists_url":"https://api.github.com/users/tomaka/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaka/subscriptions","organizations_url":"https://api.github.com/users/tomaka/orgs","repos_url":"https://api.github.com/users/tomaka/repos","events_url":"https://api.github.com/users/tomaka/events{/privacy}","received_events_url":"https://api.github.com/users/tomaka/received_events","type":"User","site_admin":false},"repo":{"id":52353408,"node_id":"MDEwOlJlcG9zaXRvcnk1MjM1MzQwOA==","name":"winit","full_name":"tomaka/winit","owner":{"login":"tomaka","id":1412254,"node_id":"MDQ6VXNlcjE0MTIyNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1412254?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaka","html_url":"https://github.com/tomaka","followers_url":"https://api.github.com/users/tomaka/followers","following_url":"https://api.github.com/users/tomaka/following{/other_user}","gists_url":"https://api.github.com/users/tomaka/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaka/subscriptions","organizations_url":"https://api.github.com/users/tomaka/orgs","repos_url":"https://api.github.com/users/tomaka/repos","events_url":"https://api.github.com/users/tomaka/events{/privacy}","received_events_url":"https://api.github.com/users/tomaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomaka/winit","description":"Window handling library in pure Rust","fork":false,"url":"https://api.github.com/repos/tomaka/winit","forks_url":"https://api.github.com/repos/tomaka/winit/forks","keys_url":"https://api.github.com/repos/tomaka/winit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomaka/winit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomaka/winit/teams","hooks_url":"https://api.github.com/repos/tomaka/winit/hooks","issue_events_url":"https://api.github.com/repos/tomaka/winit/issues/events{/number}","events_url":"https://api.github.com/repos/tomaka/winit/events","assignees_url":"https://api.github.com/repos/tomaka/winit/assignees{/user}","branches_url":"https://api.github.com/repos/tomaka/winit/branches{/branch}","tags_url":"https://api.github.com/repos/tomaka/winit/tags","blobs_url":"https://api.github.com/repos/tomaka/winit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomaka/winit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomaka/winit/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomaka/winit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomaka/winit/statuses/{sha}","languages_url":"https://api.github.com/repos/tomaka/winit/languages","stargazers_url":"https://api.github.com/repos/tomaka/winit/stargazers","contributors_url":"https://api.github.com/repos/tomaka/winit/contributors","subscribers_url":"https://api.github.com/repos/tomaka/winit/subscribers","subscription_url":"https://api.github.com/repos/tomaka/winit/subscription","commits_url":"https://api.github.com/repos/tomaka/winit/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomaka/winit/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomaka/winit/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomaka/winit/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomaka/winit/contents/{+path}","compare_url":"https://api.github.com/repos/tomaka/winit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomaka/winit/merges","archive_url":"https://api.github.com/repos/tomaka/winit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomaka/winit/downloads","issues_url":"https://api.github.com/repos/tomaka/winit/issues{/number}","pulls_url":"https://api.github.com/repos/tomaka/winit/pulls{/number}","milestones_url":"https://api.github.com/repos/tomaka/winit/milestones{/number}","notifications_url":"https://api.github.com/repos/tomaka/winit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomaka/winit/labels{/name}","releases_url":"https://api.github.com/repos/tomaka/winit/releases{/id}","deployments_url":"https://api.github.com/repos/tomaka/winit/deployments","created_at":"2016-02-23T11:17:06Z","updated_at":"2018-06-02T16:28:21Z","pushed_at":"2018-06-02T22:06:02Z","git_url":"git://github.com/tomaka/winit.git","ssh_url":"git@github.com:tomaka/winit.git","clone_url":"https://github.com/tomaka/winit.git","svn_url":"https://github.com/tomaka/winit","homepage":null,"size":6669,"stargazers_count":317,"watchers_count":317,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":133,"mirror_url":null,"archived":false,"open_issues_count":99,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":133,"open_issues":99,"watchers":317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tomaka/winit/pulls/442"},"html":{"href":"https://github.com/tomaka/winit/pull/442"},"issue":{"href":"https://api.github.com/repos/tomaka/winit/issues/442"},"comments":{"href":"https://api.github.com/repos/tomaka/winit/issues/442/comments"},"review_comments":{"href":"https://api.github.com/repos/tomaka/winit/pulls/442/comments"},"review_comment":{"href":"https://api.github.com/repos/tomaka/winit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tomaka/winit/pulls/442/commits"},"statuses":{"href":"https://api.github.com/repos/tomaka/winit/statuses/c2e030a6461f8e4b62f54fcb1cfd8329a1796f47"}},"author_association":"NONE"}}
{"actor":{"display_login":"francesca64"}}