{"action":"created","issue":{"url":"https://api.github.com/repos/tomaka/winit/issues/548","repository_url":"https://api.github.com/repos/tomaka/winit","labels_url":"https://api.github.com/repos/tomaka/winit/issues/548/labels{/name}","comments_url":"https://api.github.com/repos/tomaka/winit/issues/548/comments","events_url":"https://api.github.com/repos/tomaka/winit/issues/548/events","html_url":"https://github.com/tomaka/winit/pull/548","id":328796270,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjI4NTgw","number":548,"title":"[WIP] DPI for everyone","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tomaka/winit/milestones/1","html_url":"https://github.com/tomaka/winit/milestone/1","labels_url":"https://api.github.com/repos/tomaka/winit/milestones/1/labels","id":3323652,"node_id":"MDk6TWlsZXN0b25lMzMyMzY1Mg==","number":1,"title":"HiDPI Support","description":"","creator":{"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},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2018-05-06T18:15:38Z","updated_at":"2018-06-03T15:09:46Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-06-03T03:39:25Z","updated_at":"2018-06-04T02:11:15Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/tomaka/winit/pulls/548","html_url":"https://github.com/tomaka/winit/pull/548","diff_url":"https://github.com/tomaka/winit/pull/548.diff","patch_url":"https://github.com/tomaka/winit/pull/548.patch"},"body":"Fixes #105\r\nFixes #169\r\nFixes #185 \r\nFixes #315\r\nFixes #332 (big thanks to @kryptan for the initial work on Windows!)\r\nFixes #337\r\nFixes #469\r\n\r\nAlright, it was quite the undertaking, but I believe I've finished this on X11, Windows, macOS, iOS, Android, and Emscripten.\r\n\r\nSome caveats:\r\n- The Intel OpenGL driver on Windows still has some problems in mixed-DPI environments. It doesn't happen with DirectX or Vulkan (and OpenGL with Nvidia works fine), and it will only affect people who either A) have multiple monitors of differing scale factors, or B) change the scale factor after login. The issue itself is just that there's a small black/background-colored gap below the titlebar; this doesn't happen without DPI awareness, but I think this is an acceptable trade-off. Besides, if users disagree, it's still possible to disable DPI awareness using `EventsLoopExt`.\r\n- Android still returns a DPI factor of 1.0. As far as I can tell, getting the real value won't be possible until tomaka/android-rs-glue#116 is sorted out. However, once that's filled in the code I've added here should do all the right conversions.\r\n- I couldn't really test Emscripten, since I was unable to get anything to actually run in my browser.\r\n- iOS was an adventure, and I ended up reworking glutin's iOS backend (it's apparently been broken for quite some time). I still never got anything to render, but I can at least say that it reported the correct sizes and DPI factor. I've unfortunately introduced a small amount of GL-specific code to the iOS backend here; I plan on doing some restructuring and fixing that before this makes it into a release, but I didn't want to make this PR any more huge and monolithic than it is already.\r\n- My solution for Wayland was just to comment things out in `src/platform/linux/mod.rs` and say \"@vberger will figure this out later\"\r\n\r\nThat said, this PR is functionally complete. The only reason I've labeled it WIP is because it's still completely undocumented! I just wanted an opportunity for feedback before I start fussing over doc comments. (I also noticed that I left a `// TODO: Adjust min+max size` in the Windows backend, whoops)\r\n\r\nI won't reiterate what I wrote in `CHANGELOG.md`. Besides there, the other files I recommend looking at are `src/dpi.rs`and `src/window.rs`. You can obviously also test this, and I've provided some partial migrations of various things to help with that:\r\n- [glutin](https://github.com/francesca64/glutin/tree/super-dpi) - everything should work except for the examples, and note that `GlWindow::resize` doesn't yet explicitly take `PhysicalSize`.\r\n- [gfx pre-ll](https://github.com/francesca64/gfx/tree/super-dpi) - everything should work except for the examples.\r\n- [alacritty](https://github.com/francesca64/alacritty/tree/super-dpi) - it seems fine on macOS, though on X11 it seems to \"double upscale\" on HiDPI displays. This is almost certainly a result of the math in the auto-resize Alacritty does after creation, but I couldn't find where it does that.\r\n\r\nMigrating can be tedious, but isn't hard, and the more explicit API resulted in me fixing some bugs in my own applications. Overall, I'm pretty satisfied, but if anyone has objections, I'm in no rush to merge this. I want to release a 0.15.1 with various regression fixes before introducing any breaking changes like this."},"comment":{"url":"https://api.github.com/repos/tomaka/winit/issues/comments/394215918","html_url":"https://github.com/tomaka/winit/pull/548#issuecomment-394215918","issue_url":"https://api.github.com/repos/tomaka/winit/issues/548","id":394215918,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDIxNTkxOA==","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},"created_at":"2018-06-04T02:11:15Z","updated_at":"2018-06-04T02:11:15Z","author_association":"COLLABORATOR","body":"You have no idea how much of a relief it is when a notification is for something that isn't my fault.\r\n\r\nShouldn't this have been caught by this test? https://github.com/tomaka/winit/blob/19dd961752319276fa170c07e46963de9e3b589c/tests/send_objects.rs#L11-L15\r\n\r\n"}}
{"actor":{"display_login":"francesca64"}}