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

Window Orientation #1849

Open
bigmstone opened this issue Feb 2, 2021 · 2 comments
Open

Window Orientation #1849

bigmstone opened this issue Feb 2, 2021 · 2 comments
Labels
S - api Design and usability

Comments

@bigmstone
Copy link

I haven't found any events for handling window orientation if it changes. Particularly on mobile devices (I'm primarily interested in iOS). I am happy to do the work to plumb this myself, but since this would require changes to events I wanted to solicit some feedback from the maintainers about how to best design this. My thought is to add an Orientation event to winit::event::WindowEvent.

@msiglreith msiglreith added the S - api Design and usability label Feb 4, 2021
@msiglreith
Copy link
Member

Hi, I think this sounds reasonable and useful!
winit::event::WindowEvent looks sensible but might depend on how other OS expose it, which I'm currently not too familiar with. IIRC on Windows, an event is also sent per window, but other OS might count it as screen/monitor transformation.

@bigmstone
Copy link
Author

My assumption until this point had been that monitor-bound windows wouldn't necessarily change their orientation, but I can see how that might not be true. I am building an AR app that uses the camera of iOS devices. So when orientation changes I need to transform the quad rendering the camera accordingly. That use case doesn't have to be bound to phones though. I'd need to see how something like a Windows 10 tablet reports orientation since the exact same use case would carry over there. I can submit a WIP PR for the iOS side of this and maybe if there's someone who has more Windows experience can pitch in on the orientation of Windows devices? That might be the best way to arrive at a reasonable cross-platform API. I don't have a Windows tablet. Will have to see if I can "fake it" on my Windows laptop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - api Design and usability
Development

No branches or pull requests

2 participants