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

Event waiting with no windows documentation / code discrepancy #1317

Closed
dougbinks opened this issue Aug 27, 2018 · 2 comments
Closed

Event waiting with no windows documentation / code discrepancy #1317

dougbinks opened this issue Aug 27, 2018 · 2 comments
Assignees
Labels
bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs
Milestone

Comments

@dougbinks
Copy link
Contributor

Currently the event processing documentation states that:

Even when you have no windows, event polling needs to be done in order to receive monitor connection events.

However the code for both glfwWaitEvents() and glfwPostEmptyEvent() require a window present to work. This should likely either be documented or fixed. See this thead on event loops without windows for reasoning behind why it might be preferable to handle this by making the event loop work without windows if this is possible on all platforms.

This appears to be related to issue #1281.

I would be able to handle the windows implementation, but am not familiar enough with the other backend event processing (I know it's a bit of a minefield from experience) if a fix is desired.

@elmindreda elmindreda self-assigned this Oct 14, 2018
@elmindreda elmindreda added bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs labels Dec 24, 2018
elmindreda added a commit that referenced this issue Dec 25, 2018
This removes the GLFW NSApplication subclass as a step towards better
coexistence with other libraries that touch Cocoa.

This moves application object creation to platform init to allow event
processing before window creation.

Related to #1317.
elmindreda added a commit that referenced this issue Jan 11, 2019
The application delegate needs to be set at init to receive monitor
events before window creation.  Menu creation is moved to
applicationWillFinishLaunching: to play nicer with other toolkits in the
same process.

Related to #1317.
@elmindreda
Copy link
Member

elmindreda commented Jan 11, 2019

The weird behavior of glfwWaitEvents being a no-op without windows was due partly to GLFW at that time not having hidden helper windows on platforms where events can only be received via windows, and partly to AppKit not being initialized until window creation and I didn't yet feel confident modifying the semi-undocumented way GLFW does that.

With 88c5edb and ea7eb2d those issues should be resolved, so I would be in favor of dropping that behavior from glfwWaitEvents and glfwPostEmptyEvent in 3.3.

@elmindreda elmindreda added this to the 3.3 milestone Jan 13, 2019
@elmindreda
Copy link
Member

However the code for both glfwWaitEvents() and glfwPostEmptyEvent() require a window present to work.

This requirement has now been removed with 55b1a16. Thank you!

m4ce-w1ndu pushed a commit to m4ce-w1ndu/glfw that referenced this issue Jul 23, 2022
This removes the GLFW NSApplication subclass as a step towards better
coexistence with other libraries that touch Cocoa.

This moves application object creation to platform init to allow event
processing before window creation.

Related to glfw#1317.
m4ce-w1ndu pushed a commit to m4ce-w1ndu/glfw that referenced this issue Jul 23, 2022
The application delegate needs to be set at init to receive monitor
events before window creation.  Menu creation is moved to
applicationWillFinishLaunching: to play nicer with other toolkits in the
same process.

Related to glfw#1317.
m4ce-w1ndu pushed a commit to m4ce-w1ndu/glfw that referenced this issue Jul 23, 2022
This lets an application wait for non-window events without needing to
create a window.

Fixes glfw#1317.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs
Projects
None yet
Development

No branches or pull requests

3 participants