Permalink
Browse files

Win32: Fix maximization of undecorated windows

Fixes #899.
  • Loading branch information...
elmindreda committed Oct 31, 2017
1 parent a7a70cf commit 80d181f12dbb3b19fa649638252fa90eacf3d6a2
Showing with 17 additions and 0 deletions.
  1. +1 −0 README.md
  2. +16 −0 src/win32_window.c
View
@@ -200,6 +200,7 @@ information on what to include when reporting a bug.
- [Win32] Bugfix: Disabled cursor mode prevented use of caption buttons
(#650,#1071)
- [Win32] Bugfix: Returned key names did not match other platforms (#943)
- [Win32] Bugfix: Undecorated windows did not maximize to workarea (#899)
- [X11] Moved to XI2 `XI_RawMotion` for disable cursor mode motion input (#125)
- [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
- [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X
View
@@ -951,6 +951,22 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
mmi->ptMaxTrackSize.y = window->maxheight + yoff;
}
if (!window->decorated)
{
MONITORINFO mi;
const HMONITOR mh = MonitorFromWindow(window->win32.handle,
MONITOR_DEFAULTTONEAREST);
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
GetMonitorInfo(mh, &mi);
mmi->ptMaxPosition.x = mi.rcWork.left - mi.rcMonitor.left;
mmi->ptMaxPosition.y = mi.rcWork.top - mi.rcMonitor.top;
mmi->ptMaxSize.x = mi.rcWork.right - mi.rcWork.left;
mmi->ptMaxSize.y = mi.rcWork.bottom - mi.rcWork.top;
}
return 0;
}

0 comments on commit 80d181f

Please sign in to comment.