From 59a4d585946cccee025522fec0e8eb3853d1c477 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 9 Nov 2021 01:59:38 +0300 Subject: [PATCH] Pick another fix of window sizing (window sometimes becomes too large even with the previous patch) --- ...1e4d19141b60850fc542abab6251c4f119c9.patch | 44 +++++++++++++++++++ chromium-browser-stable.spec | 6 ++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 314a1e4d19141b60850fc542abab6251c4f119c9.patch diff --git a/314a1e4d19141b60850fc542abab6251c4f119c9.patch b/314a1e4d19141b60850fc542abab6251c4f119c9.patch new file mode 100644 index 0000000..5b307fb --- /dev/null +++ b/314a1e4d19141b60850fc542abab6251c4f119c9.patch @@ -0,0 +1,44 @@ +From 314a1e4d19141b60850fc542abab6251c4f119c9 Mon Sep 17 00:00:00 2001 +From: Alexander Dunaev +Date: Wed, 27 Oct 2021 03:27:25 +0000 +Subject: [PATCH] [linux/x11] Made the hidden window ignoring new properties. + +It turned out that the window manager can withdraw certain window +properties when the client unmaps the window (e. g., KWin resets the +maximised state), which in certain scenarios (see the linked crbug) may +cause the window to get incorrect state after restart. + +At the same time, changing the properties when the window is hidden does +not seem to make a lot of sense. If the window is hidden before being +destroyed, accepting new properties makes no sense at all, and if it is +going to be shown again later, it may/should be configured upon showing. + +This patch adds a condition that ignores new properties for hidden +windows. + +Bug: 1260832 +Change-Id: I46cf7b8b26f166591081410a462fc31c758c0529 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3245090 +Reviewed-by: Thomas Anderson +Commit-Queue: Alexander Dunaev +Cr-Commit-Position: refs/heads/main@{#935285} +--- + ui/platform_window/x11/x11_window.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc +index dd38174733676..570621a1c6caa 100644 +--- a/ui/platform_window/x11/x11_window.cc ++++ b/ui/platform_window/x11/x11_window.cc +@@ -2241,6 +2241,11 @@ void X11Window::OnWMStateUpdated() { + + void X11Window::UpdateWindowProperties( + const base::flat_set& new_window_properties) { ++ // If the window is hidden, ignore new properties. ++ // See https://crbug.com/1260832 ++ if (!window_mapped_in_client_) ++ return; ++ + window_properties_ = new_window_properties; + + // Ignore requests by the window manager to enter or exit fullscreen (e.g. as diff --git a/chromium-browser-stable.spec b/chromium-browser-stable.spec index 4bcd8ee..17f93ae 100644 --- a/chromium-browser-stable.spec +++ b/chromium-browser-stable.spec @@ -84,7 +84,7 @@ Summary: A fast web browser based on the Blink engine Name: chromium-browser-stable Version: 95.0.4638.69 -Release: 1 +Release: 2 License: BSD, LGPL Group: Networking/WWW Url: https://www.chromium.org/Home @@ -125,8 +125,10 @@ Patch647: ALT-allow-to-override-clang-through-env-variables.patch # XXX This patch is not enough to fully fix debuginfo and debugsource subpackages Patch648: fix-debugsource.patch Patch649: off-java-check.patch +# https://bugs.chromium.org/p/chromium/issues/detail?id=1260832 +Patch650: 314a1e4d19141b60850fc542abab6251c4f119c9.patch # https://bugs.chromium.org/p/chromium/issues/detail?id=1260821 (already backported to 96) -Patch650: 24a90f9327ac1a4d2b6dbb410cd28f65e3e33839.patch +Patch651: 24a90f9327ac1a4d2b6dbb410cd28f65e3e33839.patch BuildRequires: bison BuildRequires: llvm12