[metacity] compositor-xrender: do not create shadows when disabled
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor-xrender: do not create shadows when disabled
- Date: Mon, 13 Jul 2020 17:28:10 +0000 (UTC)
commit 5645c166e9a44e55d98b819814dc6c13dfd97c89
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Jul 13 20:19:00 2020 +0300
compositor-xrender: do not create shadows when disabled
https://gitlab.gnome.org/GNOME/metacity/-/issues/12
src/compositor/meta-compositor-xrender.c | 6 ++++++
src/compositor/meta-compositor-xrender.h | 2 ++
src/compositor/meta-surface-xrender.c | 12 +++++++-----
3 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 64b8eaea..6acd3297 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -1192,6 +1192,12 @@ meta_compositor_xrender_new (MetaDisplay *display,
NULL);
}
+gboolean
+meta_compositor_xrender_have_shadows (MetaCompositorXRender *self)
+{
+ return self->have_shadows;
+}
+
MetaShadowXRender *
meta_compositor_xrender_create_shadow (MetaCompositorXRender *self,
MetaSurface *surface)
diff --git a/src/compositor/meta-compositor-xrender.h b/src/compositor/meta-compositor-xrender.h
index b419ee63..d07c47ec 100644
--- a/src/compositor/meta-compositor-xrender.h
+++ b/src/compositor/meta-compositor-xrender.h
@@ -31,6 +31,8 @@ G_DECLARE_FINAL_TYPE (MetaCompositorXRender, meta_compositor_xrender,
MetaCompositor *meta_compositor_xrender_new (MetaDisplay *display,
GError **error);
+gboolean meta_compositor_xrender_have_shadows (MetaCompositorXRender *self);
+
MetaShadowXRender *meta_compositor_xrender_create_shadow (MetaCompositorXRender *self,
MetaSurface *surface);
diff --git a/src/compositor/meta-surface-xrender.c b/src/compositor/meta-surface-xrender.c
index f8a03e8a..1ce839fe 100644
--- a/src/compositor/meta-surface-xrender.c
+++ b/src/compositor/meta-surface-xrender.c
@@ -497,16 +497,18 @@ meta_surface_xrender_pre_paint (MetaSurface *surface,
if (self->shadow_changed)
{
+ MetaCompositor *compositor;
+ MetaCompositorXRender *compositor_xrender;
+
+ compositor = meta_surface_get_compositor (surface);
+ compositor_xrender = META_COMPOSITOR_XRENDER (compositor);
+
if (self->shadow == NULL &&
+ meta_compositor_xrender_have_shadows (compositor_xrender) &&
meta_surface_has_shadow (surface))
{
- MetaCompositor *compositor;
- MetaCompositorXRender *compositor_xrender;
XserverRegion shadow_region;
- compositor = meta_surface_get_compositor (surface);
- compositor_xrender = META_COMPOSITOR_XRENDER (compositor);
-
self->shadow = meta_compositor_xrender_create_shadow (compositor_xrender,
surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]