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

Add EventsLoop::wakeup independent of interrupt #175

Closed
jwilm opened this issue May 10, 2017 · 6 comments
Closed

Add EventsLoop::wakeup independent of interrupt #175

jwilm opened this issue May 10, 2017 · 6 comments

Comments

@jwilm
Copy link
Contributor

jwilm commented May 10, 2017

The method EventsLoop::interrupt() is currently serving the dual purpose of

  1. Stop processing events during run_forever and poll_events
  2. Wakeup the event loop from other threads

Running the wakeup code when you only care about 1. simply wastes cycles.

I'm proposing that a second method, EventsLoop::wakeup() is added to allow performing these tasks independently. An alternative design would be removing the interrupted flag altogether and allow the closure passed to run_forever and poll_events to return a flag indicating their desire to continue or halt.

@jwilm
Copy link
Contributor Author

jwilm commented May 10, 2017

Btw, I'd be happy to implement this. I thought discussion was an appropriate first step, though.

@jwilm
Copy link
Contributor Author

jwilm commented May 11, 2017

I've thought about this a bit more, and I think it would be appropriate for the wakeup method to take a winit::WindowId so that the Awakened event is associated with the correct window.

@jwilm
Copy link
Contributor Author

jwilm commented May 11, 2017

Digging into the source a bit, it looks like there's some leftover WindowProxy implementations. These aren't available in the public API anymore since the recent event handling refactor. Seems like they should be removed / be absorbed into EventsLoop::wakeup implementations.

@jwilm
Copy link
Contributor Author

jwilm commented May 19, 2017

Does anyone have feedback about this?

@mitchmindtree
Copy link
Contributor

@jwilm just thought I'd let you know that #136 and in particular this comment are related to (and probably supersede) this.

@jwilm
Copy link
Contributor Author

jwilm commented May 23, 2017

Agreed that the pending Proxy type should supersede this.

@jwilm jwilm closed this as completed May 23, 2017
tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
…orking-again

Get magicleap working again
madsmtm pushed a commit to madsmtm/winit that referenced this issue Jun 11, 2022
…indowing#176)

* use geometry() to get monitor size

* add .change file

* Update linux-monitor-size.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants