mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Win32: Fix GLFW_MAXIMIZED not maximizing window
The window rect adjustment for content scale broke the initial, correct
maximization performed when creating the window with WS_MAXIMIZE. This
switches to updating the restored rect instead of the current rect.
Fixes #1499.
Closes #1503.
(cherry picked from commit 711b9694a1
)
This commit is contained in:
parent
116f4c831d
commit
30e67357be
@ -124,6 +124,8 @@ information on what to include when reporting a bug.
|
|||||||
symbol redefinition (#1524)
|
symbol redefinition (#1524)
|
||||||
- [Win32] Bugfix: The cursor position event was emitted before its cursor enter
|
- [Win32] Bugfix: The cursor position event was emitted before its cursor enter
|
||||||
event (#1490)
|
event (#1490)
|
||||||
|
- [Win32] Bugfix: The window hint `GLFW_MAXIMIZED` did not move or resize the
|
||||||
|
window (#1499)
|
||||||
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
|
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
|
||||||
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
|
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
|
||||||
(#1462,#1528)
|
(#1462,#1528)
|
||||||
|
@ -1281,6 +1281,7 @@ static int createNativeWindow(_GLFWwindow* window,
|
|||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
{
|
{
|
||||||
RECT rect = { 0, 0, wndconfig->width, wndconfig->height };
|
RECT rect = { 0, 0, wndconfig->width, wndconfig->height };
|
||||||
|
WINDOWPLACEMENT wp = { sizeof(wp) };
|
||||||
|
|
||||||
if (wndconfig->scaleToMonitor)
|
if (wndconfig->scaleToMonitor)
|
||||||
{
|
{
|
||||||
@ -1301,10 +1302,11 @@ static int createNativeWindow(_GLFWwindow* window,
|
|||||||
else
|
else
|
||||||
AdjustWindowRectEx(&rect, style, FALSE, exStyle);
|
AdjustWindowRectEx(&rect, style, FALSE, exStyle);
|
||||||
|
|
||||||
SetWindowPos(window->win32.handle, NULL,
|
// Only update the restored window rect as the window may be maximized
|
||||||
rect.left, rect.top,
|
GetWindowPlacement(window->win32.handle, &wp);
|
||||||
rect.right - rect.left, rect.bottom - rect.top,
|
wp.rcNormalPosition = rect;
|
||||||
SWP_NOACTIVATE | SWP_NOZORDER);
|
wp.showCmd = SW_HIDE;
|
||||||
|
SetWindowPlacement(window->win32.handle, &wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
DragAcceptFiles(window->win32.handle, TRUE);
|
DragAcceptFiles(window->win32.handle, TRUE);
|
||||||
|
Loading…
Reference in New Issue
Block a user