Skip to content

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Aug 13, 2025

This is removed in the next Winit version, and it forces needless indentation in the examples.

@madsmtm madsmtm force-pushed the madsmtm/simpler-examples branch from e277283 to 58af263 Compare August 13, 2025 15:38
Event::WindowEvent { window_id, event },
event_loop,
);
(self.event)(state, surface_state, window_id, event, event_loop);
Copy link
Member

Choose a reason for hiding this comment

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

User code compared the window_id (good practice even though we don't open multiple windows iirc). Can we do that here based on the window, or don't we have it yet (hard to tell from a phone screen, is it the sometimes-unused T generic argument)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could add a:

if window_id != window.id() {
    return;
}

branch if you want? It just seems needless IMO for single-window applications.

Copy link
Member

Choose a reason for hiding this comment

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

Doing so sets a good example, especially if you can do it nicely isolated in one place now? Perhaps then we no longer need to pass it into the closure, nothing seems to use it right?

@notgull
Copy link
Member

notgull commented Aug 13, 2025

LGTM except for the Clippy warning

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.

3 participants