From 21b3dad2380639573c251d95910bcb644049ee5f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 27 Feb 2023 17:36:03 +0100 Subject: Allow disabling the SHAPE extension at runtime To correctly render a window making use of SHAPE, a compositor must query the shape rectangles. This may not be a desirable feature for a Wayland compositor. Allow SHAPE to be turned off at runtime, so that the compositor can opt-out. Signed-off-by: Simon Ser --- include/extinit.h | 1 + mi/miinitext.c | 2 +- os/utils.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/extinit.h b/include/extinit.h index 46081ad30..59d18962f 100644 --- a/include/extinit.h +++ b/include/extinit.h @@ -108,6 +108,7 @@ extern _X_EXPORT Bool noScreenSaverExtension; extern void ScreenSaverExtensionInit(void); #endif +extern _X_EXPORT Bool noShapeExtension; extern void ShapeExtensionInit(void); #ifdef MITSHM diff --git a/mi/miinitext.c b/mi/miinitext.c index 2e4aba534..26c1eb03c 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -109,7 +109,7 @@ SOFTWARE. /* List of built-in (statically linked) extensions */ static const ExtensionModule staticExtensions[] = { {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, + {ShapeExtensionInit, "SHAPE", &noShapeExtension}, #ifdef MITSHM {ShmExtensionInit, "MIT-SHM", &noMITShmExtension}, #endif diff --git a/os/utils.c b/os/utils.c index 405bf7d8b..a4712d0bf 100644 --- a/os/utils.c +++ b/os/utils.c @@ -143,6 +143,7 @@ Bool noMITShmExtension = FALSE; Bool noRRExtension = FALSE; #endif Bool noRenderExtension = FALSE; +Bool noShapeExtension = FALSE; #ifdef XCSECURITY Bool noSecurityExtension = FALSE; -- cgit v1.2.1