mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 04:54:35 +00:00
Ignore configure events of 0×0px
This commit is contained in:
parent
0e759c9422
commit
f710db6504
@ -318,22 +318,25 @@ static void xdgToplevelHandleConfigure(void* data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!maximized && !fullscreen)
|
if (width != 0 && height != 0)
|
||||||
{
|
{
|
||||||
if (window->numer != GLFW_DONT_CARE && window->denom != GLFW_DONT_CARE)
|
if (!maximized && !fullscreen)
|
||||||
{
|
{
|
||||||
aspectRatio = (float)width / (float)height;
|
if (window->numer != GLFW_DONT_CARE && window->denom != GLFW_DONT_CARE)
|
||||||
targetRatio = (float)window->numer / (float)window->denom;
|
{
|
||||||
if (aspectRatio < targetRatio)
|
aspectRatio = (float)width / (float)height;
|
||||||
height = width / targetRatio;
|
targetRatio = (float)window->numer / (float)window->denom;
|
||||||
else if (aspectRatio > targetRatio)
|
if (aspectRatio < targetRatio)
|
||||||
width = height * targetRatio;
|
height = width / targetRatio;
|
||||||
|
else if (aspectRatio > targetRatio)
|
||||||
|
width = height * targetRatio;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_glfwInputWindowSize(window, width, height);
|
_glfwInputWindowSize(window, width, height);
|
||||||
_glfwPlatformSetWindowSize(window, width, height);
|
_glfwPlatformSetWindowSize(window, width, height);
|
||||||
_glfwInputWindowDamage(window);
|
_glfwInputWindowDamage(window);
|
||||||
|
}
|
||||||
|
|
||||||
if (!activated && window->autoIconify)
|
if (!activated && window->autoIconify)
|
||||||
_glfwPlatformIconifyWindow(window);
|
_glfwPlatformIconifyWindow(window);
|
||||||
|
Loading…
Reference in New Issue
Block a user