-
-
Notifications
You must be signed in to change notification settings - Fork 93
Description
Describe the bug
If you connect or disconnect monitors (Screens) while your mac laptop is awake, you reliably get monitor change events per this callback:
glfw.SetMonitorCallback(a.MonitorChange)
However, if you close your laptop lid, then disconnect an external monitor, then open the lid and sign in, there are no events forthcoming from glfw to let you know that your monitor configuration is not as it was before.
Furthermore, my attempts to google "mac awake from sleep event" did not return anything useful, although admittedly I did not spend an exhaustive amount of time on this.
Basically, we need to somehow get an event when it wakes up (and after you sign in presumably), and then we could check the current list of monitors against whatever was last saved, and then drive a change event if these are different.
Alternatively, we could just poll the monitors every minute or so, using a "last polled" timestamp that is checked in the event loop (including paint events). Typically a wake from sleep scenario would result in a long interval and thus an immediate update upon awaking.
Ok, that is sufficiently actionable that I will go ahead and implement! :)
How to reproduce
do it.
Example code
No response
Relevant output
No response
Platform
macOS
Metadata
Metadata
Assignees
Labels
Type
Projects
Status