From f33205a49067e708a25c61c775c980ac617a7a9f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 29 May 2019 17:07:42 +0530 Subject: [PATCH] Wayland: Fix maximizing the window on a compositor that does not provide server side window decorations, such a GNOME or Weston not working Fixes #1662 --- docs/changelog.rst | 4 ++++ glfw/wl_window.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7d2d61b26..b6342ba7d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -34,6 +34,10 @@ To update |kitty|, :doc:`follow the instructions `. - Linux: Automatically increase cell height if the font being used is broken and draws the underscore outside the bounding box (:iss:`690`) +- Wayland: Fix maximizing the window on a compositor that does not provide + server side window decorations, such a GNOME or Weston not working + (:iss:`1662`) + 0.14.0 [2019-05-24] --------------------- diff --git a/glfw/wl_window.c b/glfw/wl_window.c index c947f45b1..1f9521404 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -551,6 +551,12 @@ static void xdgToplevelHandleConfigure(void* data, } } window->wl.fullscreened = fullscreen; + if (maximized && !fullscreen) { + if (window->decorated && !window->wl.decorations.serverSide && window->wl.decorations.buffer) { + width -= _GLFW_DECORATION_HORIZONTAL; + height -= _GLFW_DECORATION_VERTICAL; + } + } dispatchChangesAfterConfigure(window, width, height); _glfwInputWindowFocus(window, activated); }