You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested under Windows 8, but probably exists for prior versions, _glfw.monitorCallback is only being called on physical device connects/disconnects. The cause of this is that it relies on the WM_DEVICECHANGE/DBT_DEVNODES_CHANGED message which is, of course, only sent when a physical device is connected or disconnected from the system. This means that enabling or disabling displays (e.g., turning extended display settings on/off) does not trigger a callback and cannot be re-enumerated without restarting the program.
By using Spy++ to watch notifications sent when displays were enabled/disabled I was able to identify a few notifications that are triggered through this action, of which WM_DISPLAYCHANGE is the most promising (the others tended to get sent multiple times). As a proof of concept, I modified windowProc in win32_window.c, but I have concerns about it's suitability as a permanent solution. Off the top of my head, though, I see two reasons why this solution might not be a good one:
it means that display connects/disconnects will result in _glfwInputMonitorChange being called twice as a result of handling both 'WM_DEVICECHANGEandWM_DISPLAYCHANGE`.
it means that initiating a video mode change will result in _glfwInputMonitorChange being called unnecessarily.
There is probably a better way of handling this scenario, but Windows isn't my thing and I don't really know how else to integrate support for handling display enabling/disabling with the existing methods for handling notifications.
Regardless, as enabling/disabling monitors without disconnecting them is a common usage scenario this is something that probably should be supported.
The text was updated successfully, but these errors were encountered:
This issue has been moved from SourceForge.
The text was updated successfully, but these errors were encountered: