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

Remove event::Raw in favour of using event::Input #855

Merged
merged 5 commits into from
Nov 13, 2016

Conversation

mitchmindtree
Copy link
Contributor

@mitchmindtree mitchmindtree commented Nov 12, 2016

From the commit message:

Prior to this commit, conrod took event::Raw as the event type that
drove forward the Ui and from which the Ui would generate
higher-level Events. It turns out we only ever really used the
event::Raw's Input variant, so to make our API more concise I
thought we could remove the unnecessary indirection of event::Raw.

One problem this does raise is that on Mac OS, we use the event::Raw's
Render variant as a hack to track the window's size changes. This is
only because glutin (winit) is unable to emit events during resizing on
Mac OS. To get around the removal of this hack, I'm planning to submit a
PR to glutin_window (used by the piston backend present in most of the
examples) which will insert Resize events manually.

As a result of this change, we must also now pass the initial window
dimensions to the Ui's constructor.

This commit also updates the related event module docs.

Here is the PR that should fix the resize issues that appear on Mac OS when using the examples that depend on the piston feature: PistonDevelopers/glutin_window#99. Note that this is not related to the issue mentioned in #850 or #854.

Closes #820.

Prior to this commit, conrod took `event::Raw` as the event type that
drove forward the `Ui` and from which the `Ui` would generate
higher-level `Event`s. It turns out we only ever really used the
`event::Raw`'s `Input` variant, so to make our API more concise I
thought we could remove the unnecessary indirection of `event::Raw`.

One problem this does raise is that on Mac OS, we use the `event::Raw`'s
`Render` variant as a hack to track the window's size changes. This is
only because glutin (winit) is unable to emit events during resizing on
Mac OS. To get around the removal of this hack, I'm planning to submit a
PR to glutin_window (used by the piston backend present in most of the
examples) which will insert `Resize` events manually.

As a result of this change, we must also now pass the initial window
dimensions to the `Ui`'s constructor.

This commit also updates the related event module docs.
@mitchmindtree
Copy link
Contributor Author

Okydoke, the fix for Resize events was published in glutin_window v0.32.0, so I've updated our glutin_window dependency accordingly and resizing seems to work in the examples 👍

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.

Use piston::input::Input as the Raw event type rather than piston::input::Event
1 participant