Generate missing Resize events by tracking window and resize dimensions #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
anddraw_size
events by using theglutin::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.