From f710db6504086f064e424a04af32f6ac2844fcb2 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 4 Jan 2018 21:55:09 +0100 Subject: [PATCH] =?UTF-8?q?Ignore=20configure=20events=20of=200=C3=970px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wl_window.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 21b2b19a..3c700bf4 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -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; - targetRatio = (float)window->numer / (float)window->denom; - if (aspectRatio < targetRatio) - height = width / targetRatio; - else if (aspectRatio > targetRatio) - width = height * targetRatio; + if (window->numer != GLFW_DONT_CARE && window->denom != GLFW_DONT_CARE) + { + aspectRatio = (float)width / (float)height; + targetRatio = (float)window->numer / (float)window->denom; + if (aspectRatio < targetRatio) + height = width / targetRatio; + else if (aspectRatio > targetRatio) + width = height * targetRatio; + } } - } - _glfwInputWindowSize(window, width, height); - _glfwPlatformSetWindowSize(window, width, height); - _glfwInputWindowDamage(window); + _glfwInputWindowSize(window, width, height); + _glfwPlatformSetWindowSize(window, width, height); + _glfwInputWindowDamage(window); + } if (!activated && window->autoIconify) _glfwPlatformIconifyWindow(window);