Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of winit in examples #65

Closed
lovesegfault opened this issue Apr 13, 2020 · 4 comments
Closed

Fix usage of winit in examples #65

lovesegfault opened this issue Apr 13, 2020 · 4 comments
Labels
duplicate This issue or pull request already exists question Usability question

Comments

@lovesegfault
Copy link
Contributor

None of our examples work on Wayland. Upon some investigation I discovered that this is due to us misusing winit. From IRC:

2020-04-12 01:34:32 kchibisov   lovesegfault: let me debug your thing.
2020-04-12 01:36:44 kchibisov   Oh, I've got the issue.
2020-04-12 01:37:16 kchibisov   yeah, they are calling to monitor too early.
2020-04-12 01:37:32 kchibisov   I absolutely hate what they are doing so.
2020-04-12 01:39:32 lovesegfault    kchibisov: Yeah, did you find they part where they draw the hidden window to figure out a good size?
2020-04-12 01:40:31 kchibisov   yeah, they are doing shit.
2020-04-12 01:40:47 kchibisov   like this code is just bad and won't work..
2020-04-12 01:41:03 kchibisov   first of all `set_inner_size` doesn't guarantee you anything.
2020-04-12 01:41:27 kchibisov   set_outer_position is not a thing on some systems.
2020-04-12 01:42:17 kchibisov   Also, on HiDPI system, initial scale factor is always 1.
2020-04-12 01:42:26 kchibisov   so you'll resize anyways.
2020-04-12 01:43:45 kchibisov   I'll propose to just use scale factor instead of monitor dimensions magic, since THERE'S NO GUARANTEE THAT THEY ARE CORRECT.
2020-04-12 01:44:34 kchibisov   like just use scale factor and don't be smart.
@parasyte
Copy link
Owner

I'm aware of this. See #29

BTW nice code review, "doing shit" and "this code is just bad". 🤣

@parasyte parasyte added duplicate This issue or pull request already exists question Usability question labels Apr 13, 2020
@lovesegfault
Copy link
Contributor Author

Perhaps I should have omitted the "IRC rawness" 😆

Nonetheless, I thought the interesting parts were:

  1. just use scale factor instead of monitor dimensions magic
  2. they are calling to monitor too early.

(2) in particular seems to imply this is fixable without relying on rust-windowing/winit#1190 which (so far) would imply breaking macOS compat.

@parasyte
Copy link
Owner

parasyte commented Apr 13, 2020

It's disappointing that the winit API even allows this kind of invalid usage on the Wayland backend. This appears to be a result of the following:

  1. "There are several issues with wayland. Most of them come from the fact that wayland does things differently than other platforms."
  2. winit doesn't have a dedicated maintainer for the Wayland backend

But that doesn't really change anything for us. We do need to improve the examples to work on Wayland, regardless of winit's fallible API.

@parasyte
Copy link
Owner

Closing this as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Usability question
Projects
None yet
Development

No branches or pull requests

2 participants