From 111c1234355c8dc224e5f0d68ad6c2c7e793f9bb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 13 Apr 2021 12:48:23 +0530 Subject: [PATCH] X11: Fix resize_in_steps being applied even when window is maximized Fixes #3473 --- docs/changelog.rst | 3 +++ glfw/x11_window.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 47250e892..2227626de 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -124,6 +124,9 @@ To update |kitty|, :doc:`follow the instructions `. - Fix the selection getting changed if the screen contents scroll while the selection is in progress (:iss:`3431`) +- X11: Fix :opt:`resize_in_steps` being applied even when window is maximized + (:iss:`3473`) + 0.19.3 [2020-12-19] ------------------- diff --git a/glfw/x11_window.c b/glfw/x11_window.c index 398e3030a..f3648efc8 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -225,13 +225,14 @@ static void sendEventToWM(_GLFWwindow* window, Atom type, // Updates the normal hints according to the window settings // -static void updateNormalHints(_GLFWwindow* window, int width, int height) +static void +updateNormalHints(_GLFWwindow* window, int width, int height) { XSizeHints* hints = XAllocSizeHints(); if (!window->monitor) { - if (window->resizable) + if (window->resizable && !window->x11.maximized) { if (window->minwidth != GLFW_DONT_CARE && window->minheight != GLFW_DONT_CARE) @@ -1744,6 +1745,9 @@ static void processEvent(XEvent *event) if (window->x11.maximized != maximized) { window->x11.maximized = maximized; + int width, height; + _glfwPlatformGetWindowSize(window, &width, &height); + updateNormalHints(window, width, height); _glfwInputWindowMaximize(window, maximized); } }