From 0b4139123571d0c9e2fb879da40adf2e4c1022704a3e4c98977a07e020c45c79 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 10 Jan 2022 11:31:44 +0000 Subject: [PATCH] Accepting request 945213 from home:AZhou:branches:GNOME:Factory - Add mutter-initialize-saved_rect_fullscreen.patch: Some applications that starts in fullscreen disappear when switching back to normal size mode, because mutter forget to initialize saved_rect_fullscreen which is used for unfullscreen, this patch fixes it (glgo#GNOME/mutter!2210, bsc#1185444). OBS-URL: https://build.opensuse.org/request/show/945213 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=398 --- mutter-initialize-saved_rect_fullscreen.patch | 43 +++++++++++++++++++ mutter.changes | 9 ++++ mutter.spec | 5 ++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 mutter-initialize-saved_rect_fullscreen.patch diff --git a/mutter-initialize-saved_rect_fullscreen.patch b/mutter-initialize-saved_rect_fullscreen.patch new file mode 100644 index 0000000..f536dd0 --- /dev/null +++ b/mutter-initialize-saved_rect_fullscreen.patch @@ -0,0 +1,43 @@ +From 157555cf0e7aaef32892c5576e81ba2154d14a0d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Fri, 7 Jan 2022 16:30:19 +0100 +Subject: [PATCH] window: Initialize saved_rect_fullscreen too + +We save the window rect before going fullscreen to a dedicated variable, +so we can go back to the correct dimension. We also have a dedicated +variable for returning from other window states, e.g. maximized, and +this one we initialized when creating the MetaWindow. This meant that we +could always rely on this being up to date on X11 windows that were +mapped maximized or fullscreen. + +What the commit that introduced the saved rect dedicated for going +unfullscreen missed was to initialize the new saved rectangle too when +creating the MetaWindow. This resulted in windows mapped as fullscreen +often ending up misbehaving when unfullscreening, as mutter would tell +them to unfullscreen to 0x0. + +Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1786 +Fixes: a51ad8f932cb55bdd8a62fc5d8d10af7fc62b0a0 +Part-of: + + +(cherry picked from commit 13f35ab0640631566f52c80583b09fe4e3dc3685) +--- + src/core/window.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/core/window.c b/src/core/window.c +index 9b3f54df9e..6623951613 100644 +--- a/src/core/window.c ++++ b/src/core/window.c +@@ -1054,6 +1054,7 @@ _meta_window_shared_new (MetaDisplay *display, + + /* And this is our unmaximized size */ + window->saved_rect = window->rect; ++ window->saved_rect_fullscreen = window->rect; + window->unconstrained_rect = window->rect; + + window->depth = attrs->depth; +-- +GitLab + diff --git a/mutter.changes b/mutter.changes index 4f3408c..28d971c 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Jan 10 07:14:19 UTC 2022 - Alynx Zhou + +- Add mutter-initialize-saved_rect_fullscreen.patch: Some + applications that starts in fullscreen disappear when switching + back to normal size mode, because mutter forget to initialize + saved_rect_fullscreen which is used for unfullscreen, this patch + fixes it (glgo#GNOME/mutter!2210, bsc#1185444). + ------------------------------------------------------------------- Fri Dec 17 09:00:44 UTC 2021 - Alynx Zhou diff --git a/mutter.spec b/mutter.spec index 9a7fe45..bde602a 100644 --- a/mutter.spec +++ b/mutter.spec @@ -1,7 +1,7 @@ # # spec file for package mutter # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -39,6 +39,8 @@ Patch3: mutter-Lower-HIDPI_LIMIT-to-144.patch Patch4: mutter-disable-cvt-s390x.patch # PATCH-FIX-UPSTREAM mutter-allow-disable-hardware-cursors.patch glgo#GNOME/mutter!2150 alynx.zhou@suse.com -- Add a debug environment variable to disable hardware cursors. Patch5: mutter-allow-disable-hardware-cursors.patch +# PATCH-FIX-UPSTREAM mutter-initialize-saved_rect_fullscreen.patch glgo#GNOME/mutter!2210, bsc#1185444 alynx.zhou@suse.com -- Initialize saved_rect_fullscreen to fix fullscreen for some program like Stellarium. +Patch6: mutter-initialize-saved_rect_fullscreen.patch ## SLE-only patches start at 1000 # PATCH-FEATURE-SLE mutter-SLE-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box. @@ -146,6 +148,7 @@ applications that want to make use of the mutter library. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # SLE-only patches and translations. %if 0%{?sle_version}