Skip to content

Generate missing Resize events by tracking window and resize dimensions #99

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

Merged
merged 3 commits into from
Nov 13, 2016

Conversation

mitchmindtree
Copy link
Contributor

@mitchmindtree mitchmindtree commented Nov 12, 2016

Track the dimensions of the last resize event and compare them to the
window dimensions each time an event is polled in order to determine
whether or not we need to generate new Resize events. We do this in
order to solve the problem where glutin (winit) is unable to produce
Resize events for Mac OS and possibly other operating systems.

The reason why we track the last emitted resize instead of the window
dimensions is so that we avoid generating duplicate events on systems
that already successfully generate Resize events.

Also cleans up the window's size and draw_size events by using the
glutin::Window methods specified for this purpose.

@bvssvni do you think this is acceptable to add? It shouldn't affect the
behaviour for folks who already get resize events successfully, however
it should make life a bit easier for folks on Mac OS who weren't previously
able to receive Resize events and currently have to resort to doing this
sort of window size tracking themselves.

Closes #88.

Track the dimensions of the last resize event and compare them to the
window dimensions each time an event is polled in order to determine
whether or not we need to generate new Resize events. We do this in
order to solve the problem where glutin (winit) is unable to produce
Resize events for Mac OS and possibly other operating systems.

The reason why we track the last emitted resize instead of the window
dimensions is so that we avoid generating duplicate events on systems
that already successfully generate Resize events.

Also cleans up the window's `size` and `draw_size` events by using the
glutin::Window methods specified for this purpose.
@bvssvni
Copy link
Member

bvssvni commented Nov 12, 2016

This is OK! It will break the expected behavior and therefore should bump the minor version. If you do that it won't break piston_window.

@mitchmindtree
Copy link
Contributor Author

Thanks, will do!

@mitchmindtree
Copy link
Contributor Author

@bvssvni just letting you know I've also bumped the glutin dep to the latest version - hope that's ok 👍

Tested on conrod examples and Mac OS now successfully receives Resize events!

Published as 0.32.0.

@mitchmindtree mitchmindtree merged commit ba42322 into PistonDevelopers:master Nov 13, 2016
@bvssvni
Copy link
Member

bvssvni commented Nov 13, 2016

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants