Accepting request 677986 from home:iznogood:branches:GNOME:Factory

Rebased and tweaked

OBS-URL: https://build.opensuse.org/request/show/677986
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=310
This commit is contained in:
Bjørn Lie 2019-02-25 16:39:09 +00:00 committed by Git OBS Bridge
parent 1a0a01ff27
commit 9d2e045559
7 changed files with 252 additions and 5 deletions

View File

@ -0,0 +1,34 @@
From 1cb21877edd9c7c5bc991527ae70879b1e9fece0 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Thu, 11 Oct 2018 06:49:22 +0000
Subject: [PATCH] cogl-auto-texture: Avoid a double-free crash
If texture allocation fails (e.g. on an old GPU with size limit 2048)
then `cogl_texture_new_with_size` was trying to use the same CoglError
twice. The second time was after it had already been freed.
Bug reported and fix provided by Gert van de Kraats.
https://launchpad.net/bugs/1790525
(cherry picked from commit d21478b0f0163b0688abe065a7009b33453d0d00)
---
cogl/cogl/deprecated/cogl-auto-texture.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.c b/cogl/cogl/deprecated/cogl-auto-texture.c
index 29a5f73ef..fe52e1575 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.c
+++ b/cogl/cogl/deprecated/cogl-auto-texture.c
@@ -94,6 +94,7 @@ cogl_texture_new_with_size (unsigned int width,
if (!cogl_texture_allocate (tex, &skip_error))
{
cogl_error_free (skip_error);
+ skip_error = NULL;
cogl_object_unref (tex);
tex = NULL;
}
--
2.18.1

View File

@ -0,0 +1,39 @@
From 1c57a5842069735b7bb80846130bf61d0e0a0880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 25 Jan 2019 21:06:39 +0000
Subject: [PATCH] screen-cast: Fix monitor recording on HiDPI
It scaled the logical monitor rect with scale to get the stream
dimensions, but that is only valid when having
'scale-monitor-framebuffers' enabled. Even when it was, it didn't work
properly, as clutter_stage_capture_into() doesn't work properly with
scaled monitor framebuffers yet.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/415
(cherry picked from commit 3fa6a92cc5dda6ab3939c3e982185f6caf453360)
---
src/backends/meta-screen-cast-monitor-stream-src.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c b/src/backends/meta-screen-cast-monitor-stream-src.c
index 382d7d4a2..093e9f236 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -87,7 +87,11 @@ meta_screen_cast_monitor_stream_src_get_specs (MetaScreenCastStreamSrc *src,
logical_monitor = meta_monitor_get_logical_monitor (monitor);
mode = meta_monitor_get_current_mode (monitor);
- scale = logical_monitor->scale;
+ if (meta_is_stage_views_scaled ())
+ scale = logical_monitor->scale;
+ else
+ scale = 1.0;
+
*width = (int) roundf (logical_monitor->rect.width * scale);
*height = (int) roundf (logical_monitor->rect.height * scale);
*frame_rate = meta_monitor_mode_get_refresh_rate (mode);
--
2.18.1

View File

@ -0,0 +1,47 @@
From afc91f0804ad1350fa09aa141b93020f28143b48 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 5 May 2017 12:15:30 +0000
Subject: [PATCH] clutter: Avoid rounding compensation when invalidating 2D
actors
This allows the redraw clip to be more constrained, so MetaCullable doesn't
end up rendering portions of window shadows, frame and background when a
window invalidates (part of) its contents.
https://bugzilla.gnome.org/show_bug.cgi?id=782344
(cherry picked from commit a7df459416dc46321204c98197e4fd84724976e0)
---
clutter/clutter/clutter-paint-volume.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c
index b48f7f9d6..f3405138b 100644
--- a/clutter/clutter/clutter-paint-volume.c
+++ b/clutter/clutter/clutter-paint-volume.c
@@ -1166,6 +1166,21 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
+ if (pv->is_2d && pv->actor &&
+ clutter_actor_get_z_position (pv->actor) == 0)
+ {
+ /* If the volume/actor are perfectly 2D, take the bounding box as
+ * good. We won't need to add any extra room for sub-pixel positioning
+ * in this case.
+ */
+ clutter_paint_volume_free (&projected_pv);
+ box->x1 = CLUTTER_NEARBYINT (box->x1);
+ box->y1 = CLUTTER_NEARBYINT (box->y1);
+ box->x2 = CLUTTER_NEARBYINT (box->x2);
+ box->y2 = CLUTTER_NEARBYINT (box->y2);
+ return;
+ }
+
/* The aim here is that for a given rectangle defined with floating point
* coordinates we want to determine a stable quantized size in pixels
* that doesn't vary due to the original box's sub-pixel position.
--
2.18.1

View File

@ -0,0 +1,54 @@
From c6223ffea87831f9bd51d11c50e953f0318459e0 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Thu, 11 Oct 2018 07:02:05 +0000
Subject: [PATCH] clutter-offscreen-effect: Disable if no texture
If texture allocation fails (e.g. on an old GPU with size limit 2048)
then `update_fbo` would return `FALSE` but leaves `priv->offscreen`
as non-NULL. So the next paint will try to use the offscreen with a
`NULL` texture and crashes. The solution is simply to ensure that
`priv->offscreen` is NULL if there is no `priv->texture`, so the default
(non-offscreen) paint path gets used instead.
Bug reported and fix provided by Gert van de Kraats.
https://launchpad.net/bugs/1795774
(cherry picked from commit f31cf0c3ef99b27c0b2c0161fc9fc1eb82778b2e)
(cherry picked from commit 1b78ca8c5eef39831639a0bde8d613cd1bb024dc)
---
clutter/clutter/clutter-offscreen-effect.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index 1dbf29f60..5db40b79a 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -186,6 +186,12 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
priv->texture = NULL;
}
+ if (priv->offscreen != NULL)
+ {
+ cogl_handle_unref (priv->offscreen);
+ priv->offscreen = NULL;
+ }
+
priv->texture =
clutter_offscreen_effect_create_texture (self, fbo_width, fbo_height);
if (priv->texture == NULL)
@@ -196,9 +202,6 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
priv->fbo_width = fbo_width;
priv->fbo_height = fbo_height;
- if (priv->offscreen != NULL)
- cogl_handle_unref (priv->offscreen);
-
priv->offscreen = cogl_offscreen_new_to_texture (priv->texture);
if (priv->offscreen == NULL)
{
--
2.18.1

View File

@ -0,0 +1,41 @@
From 7260ba5db3fcf9b086944aef9f3d89f159ece137 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 11 Oct 2018 13:16:26 +0000
Subject: [PATCH] monitor-manager: Don't use switch-config when ensuring
configuration
Switch-configs are only to be used in certain circumstances (see
meta_monitor_manager_can_switch_config()) so when ensuring
configuration and attempting to create a linear configuration, use the
linear configuration constructor function directly without going via the
switch config method, otherwise we might incorrectly fall back to the
fallback configuration (only enable primary monitor).
This is a regression introduced by 6267732bec97773.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/342
(cherry picked from commit 149e4d69345adab2bfea84a04f88511cbad62fe0)
---
src/backends/meta-monitor-manager.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index baed7521d..d9236b928 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -561,9 +561,7 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
g_clear_object (&config);
}
- config =
- meta_monitor_config_manager_create_for_switch_config (manager->config_manager,
- META_MONITOR_SWITCH_CONFIG_ALL_LINEAR);
+ config = meta_monitor_config_manager_create_linear (manager->config_manager);
if (config)
{
if (!meta_monitor_manager_apply_monitors_config (manager,
--
2.18.1

View File

@ -1,10 +1,26 @@
-------------------------------------------------------------------
Thu Feb 21 08:13:50 UTC 2019 - bjorn.lie@gmail.com
- Add bug fix patches from upstream stable branch:
+ mutter-Avoid_double-free_crash.patch: cogl-auto-texture: Avoid
a double-free crash.
+ mutter-clutter-offscreen-effect-fix.patch:
clutter-offscreen-effect: Disable if no texture.
+ mutter-clutter-Avoid-rounding-compensation.patch: clutter:
Avoid rounding compensation when invalidating 2D actors.
+ mutter-Fix-monitor-recording-on-HiDPI.patch: screen-cast: Fix
monitor recording on HiDPI.
+ mutter-monitor-manager-Dont-use_switch-config.patch:
monitor-manager: Don't use switch-config when ensuring
configuration.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Feb 21 04:42:37 UTC 2019 - qkzhu@suse.com Thu Feb 21 04:42:37 UTC 2019 - qkzhu@suse.com
- Add mutter-Lower-HIDPI_LIMIT-to-144.patch: mutter will set scaling - Add mutter-Lower-HIDPI_LIMIT-to-144.patch: mutter will set
factor to 2 when the monitor's dpi is greater than 144 (96*1.5) to scaling factor to 2 when the monitor's dpi is greater than 144
keep GNOME's behavior consistent with YaST Installer (fate#326682, (96*1.5) to keep GNOME's behavior consistent with YaST Installer
bsc#1125467). (fate#326682, bsc#1125467).
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Nov 14 09:26:14 UTC 2018 - bjorn.lie@gmail.com Wed Nov 14 09:26:14 UTC 2018 - bjorn.lie@gmail.com

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
@ -35,6 +35,17 @@ Patch1: mutter-iconcache-Support-RGB16_565-format-for-16-bit-color-.patc
Patch2: mutter-xwayland-create-xauthority.patch Patch2: mutter-xwayland-create-xauthority.patch
# PATCH-FIX-OPENSUSE mutter-Lower-HIDPI_LIMIT-to-144.patch fate#326682, bsc#1125467 qkzhu@suse.com -- Lower HIDPI_LIMIT to 144 # PATCH-FIX-OPENSUSE mutter-Lower-HIDPI_LIMIT-to-144.patch fate#326682, bsc#1125467 qkzhu@suse.com -- Lower HIDPI_LIMIT to 144
Patch3: mutter-Lower-HIDPI_LIMIT-to-144.patch Patch3: mutter-Lower-HIDPI_LIMIT-to-144.patch
# PATCH-FIX-UPSTREAM mutter-Avoid_double-free_crash.patch -- cogl-auto-texture: Avoid a double-free crash
Patch4: mutter-Avoid_double-free_crash.patch
# PATCH-FIX-UPSTREAM mutter-clutter-offscreen-effect-fix.patch -- clutter-offscreen-effect: Disable if no texture
Patch5: mutter-clutter-offscreen-effect-fix.patch
# PATCH-FIX-UPSTREAM mutter-clutter-Avoid-rounding-compensation.patch -- clutter: Avoid rounding compensation when invalidating 2D actors
Patch6: mutter-clutter-Avoid-rounding-compensation.patch
# PATCH-FIX-UPSTREAM mutter-Fix-monitor-recording-on-HiDPI.patch -- screen-cast: Fix monitor recording on HiDPI
Patch7: mutter-Fix-monitor-recording-on-HiDPI.patch
# PATCH-FIX-UPSTREAM mutter-monitor-manager-Dont-use_switch-config.patch -- monitor-manager: Don't use switch-config when ensuring configuration
Patch8: mutter-monitor-manager-Dont-use_switch-config.patch
## SLE-only patches start at 1000 ## 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. # PATCH-FEATURE-SLE mutter-SLE-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box.
Patch1000: mutter-SLE-bell.patch Patch1000: mutter-SLE-bell.patch
@ -146,6 +157,11 @@ applications that want to make use of the mutter library.
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
# SLE-only patches and translations. # SLE-only patches and translations.
translation-update-upstream translation-update-upstream