Skip to content

Commit

Permalink
Win32: Fix monitor event emission
Browse files Browse the repository at this point in the history
Fixes #784.
  • Loading branch information
elmindreda committed Mar 14, 2017
1 parent 0df9cc2 commit 97dbd8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/win32_init.c
Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions src/win32_window.c
Expand Up @@ -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)
Expand Down

0 comments on commit 97dbd8b

Please sign in to comment.