diff --git a/README.md b/README.md index ad87fa0204..eadb273693 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ information on what to include when reporting a bug. - [Win32] Bugfix: The 32-bit Vulkan loader library static was not searched for - [Win32] Bugfix: Vulkan libraries have a new path as of SDK 1.0.42.0 (#956) - [Win32] Bugfix: Monitors with no display devices were not enumerated (#960) +- [Win32] Bugfix: Monitor events were not emitted (#784) - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading - [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X - [X11] Bugfix: Dynamic X11 library loading did not use full sonames (#941) diff --git a/src/win32_init.c b/src/win32_init.c index b092d1c7b8..785d75d343 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -307,10 +307,10 @@ static HWND createHelperWindow(void) MSG msg; HWND window = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, _GLFW_WNDCLASSNAME, - L"GLFW helper window", + L"GLFW message window", WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 1, 1, - HWND_MESSAGE, NULL, + NULL, NULL, GetModuleHandleW(NULL), NULL); if (!window) diff --git a/src/win32_window.c b/src/win32_window.c index 1e0a587e9a..7f8a63b202 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -467,14 +467,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, switch (uMsg) { + case WM_DISPLAYCHANGE: + _glfwPollMonitorsWin32(); + break; + case WM_DEVICECHANGE: { - if (wParam == DBT_DEVNODES_CHANGED) - { - _glfwPollMonitorsWin32(); - return TRUE; - } - else if (wParam == DBT_DEVICEARRIVAL) + if (wParam == DBT_DEVICEARRIVAL) { DEV_BROADCAST_HDR* dbh = (DEV_BROADCAST_HDR*) lParam; if (dbh)