From 24a90f9327ac1a4d2b6dbb410cd28f65e3e33839 Mon Sep 17 00:00:00 2001 From: Alexander Dunaev Date: Mon, 1 Nov 2021 19:29:27 +0000 Subject: [PATCH] [linux/xfce] Set zero insets on maximising the window. It turned out that Xfwm handles the frame insets not the way KWin and Mutter do, which causes wrong window size when it is maximised (see the linked crbug). This patch resets the frame insets to zero when the window is maximised, which fixes the behaviour on Xfwm. Bug: 1260821 Change-Id: I69e71049157c03b74d78bc5edb7a60bf39cdda8b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3250747 Commit-Queue: Thomas Anderson Reviewed-by: Thomas Anderson Cr-Commit-Position: refs/heads/main@{#936990} --- ui/platform_window/x11/x11_window.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc index 017ff15a0a..dd416c031e 100644 --- a/ui/platform_window/x11/x11_window.cc +++ b/ui/platform_window/x11/x11_window.cc @@ -675,6 +675,13 @@ void X11Window::Maximize() { // save this one for later too. should_maximize_after_map_ = !window_mapped_in_client_; + // Some WMs keep respecting the frame extents even if the window is maximised. + // Remove the insets when maximising. The extents will be set again when the + // window is restored to normal state. + // See https://crbug.com/1260821 + if (CanSetDecorationInsets()) + SetDecorationInsets(nullptr); + SetWMSpecState(true, x11::GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"), x11::GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); }