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

Separate role-specific methods into their own traits #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jgcodes2020
Copy link

This PR separates Window into two traits: Surface and Toplevel (subtrait of Surface). Surface handles drawing- and event-related operations, while Toplevel handles things that only work for toplevel surfaces (maximizing/minimizing, etc.).

This architecture allows us to create other subtraits of Surface to represent specific window roles. I have provided the Subview trait as a potential example of what this could be used for.

Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

But we generally still discussing how to approach stuff like that, because each platform has its own quirks.

I initially thought that the creation should be done from the parent (yes, which means not allowing to create with parent subsurface, but I think it doesn't make much sense anyway).

The end storage should be on the parent as well. There's also an issue how the addressing for stuff like that should work, in terms of IDs, etc and the fact that input events are delivered generally differently.

I'll ping you once we proceed with the winit-next, since this repo is more of a playground right now.

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

Successfully merging this pull request may close these issues.

None yet

2 participants