From 080413fe1fbde2d9d0c7c7c2d3770f7bfc4c11bf Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 19 Jan 2026 11:59:45 +0100 Subject: [PATCH] Xext: damage: DamageExtSetCritical() replace Bool by bool Prefer C standard stdbool over Xlib's own type. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/damage/damageext.c | 4 ++-- Xext/damage/damageext_priv.h | 40 ++++++++++++++++++++++++++++++++++++ Xext/damage/damageextint.h | 35 ------------------------------- Xext/panoramiX.c | 2 +- composite/compalloc.c | 7 +++++-- composite/compint.h | 1 - 6 files changed, 48 insertions(+), 41 deletions(-) create mode 100644 Xext/damage/damageext_priv.h delete mode 100644 Xext/damage/damageextint.h diff --git a/Xext/damage/damageext.c b/Xext/damage/damageext.c index 26c494371f..ab0f19b30c 100644 --- a/Xext/damage/damageext.c +++ b/Xext/damage/damageext.c @@ -32,11 +32,11 @@ #include "include/pixmapstr.h" #include "miext/extinit_priv.h" #include "os/client_priv.h" +#include "Xext/damage/damageext_priv.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" #include "xfixes/xfixes.h" -#include "damageextint.h" #include "damagestr.h" #include "protocol-versions.h" #include "dixstruct_priv.h" @@ -201,7 +201,7 @@ DamageExtDestroy(DamagePtr pDamage, void *closure) } void -DamageExtSetCritical(ClientPtr pClient, Bool critical) +DamageExtSetCritical(ClientPtr pClient, bool critical) { DamageClientPtr pDamageClient = GetDamageClient(pClient); diff --git a/Xext/damage/damageext_priv.h b/Xext/damage/damageext_priv.h new file mode 100644 index 0000000000..1413ad4129 --- /dev/null +++ b/Xext/damage/damageext_priv.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * @copyright Enrico Weigelt, metux IT consult + * + * Entry points for the generic damage extension. + * (not part of SDK, not available to external modules). + */ +#ifndef __XLIBRE_XEXT_DAMAGEEXT_PRIV_H +#define __XLIBRE_XEXT_DAMAGEEXT_PRIV_H + +#include + +#include "include/dix.h" + +/* + * Tell damage extension that upcoming damage events for given clients + * are critical output (thus need to be sent out fast) - or reverse it. + * + * Internally maintains a counter that's either increased or decreased + * by each call of this function. If the counter is above zero, events + * are sent as critical output. + * + * @param pClient pointer to the affected client + * @param critical "true" - increase the counter, otherwise decrease it. + */ +void DamageExtSetCritical(ClientPtr pClient, bool critical); + +/* + * Initialize PanoramiX specific data structures for the damage extension. + * Only called by PanoramiX extension, when it's initialized and ready run. + */ +void PanoramiXDamageInit(void); + +/* + * Reset/De-Init PanoramiX specific data strucures for the damage extension. + * Only called by PanoramiX extension, right before it's shutting down. + */ +void PanoramiXDamageReset(void); + +#endif /* __XLIBRE_XEXT_DAMAGEEXT_PRIV_H */ diff --git a/Xext/damage/damageextint.h b/Xext/damage/damageextint.h deleted file mode 100644 index 51370d2e37..0000000000 --- a/Xext/damage/damageextint.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright © 2002 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ -#ifndef _DAMAGEEXTINT_H_ -#define _DAMAGEEXTINT_H_ - -#include - -#include "include/dix.h" - -void - DamageExtSetCritical(ClientPtr pClient, Bool critical); - -void PanoramiXDamageInit(void); -void PanoramiXDamageReset(void); - -#endif /* _DAMAGEEXTINT_H_ */ diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index e40e474b8d..f144768895 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -40,6 +40,7 @@ Equipment Corporation. #include "dix/server_priv.h" #include "miext/extinit_priv.h" #include "os/osdep.h" +#include "Xext/damage/damageext_priv.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" @@ -59,7 +60,6 @@ Equipment Corporation. #include "resource.h" #include "picturestr_priv.h" #include "xfixesint.h" -#include "Xext/damage/damageextint.h" #include "compint.h" #include "protocol-versions.h" diff --git a/composite/compalloc.c b/composite/compalloc.c index c4554f50b9..d16f318c4d 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -43,8 +43,11 @@ #include +#include + #include "dix/resource_priv.h" #include "os/bug_priv.h" +#include "Xext/damage/damageext_priv.h" #include "compint.h" @@ -408,7 +411,7 @@ compRedirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update) * tell damage extension that damage events for this client are * critical output */ - DamageExtSetCritical(pClient, TRUE); + DamageExtSetCritical(pClient, true); pWin->inhibitBGPaint = TRUE; } return Success; @@ -436,7 +439,7 @@ compFreeClientSubwindows(WindowPtr pWin, XID id) * tell damage extension that damage events for this client are * critical output */ - DamageExtSetCritical(pClient, FALSE); + DamageExtSetCritical(pClient, false); csw->update = CompositeRedirectAutomatic; pWin->inhibitBGPaint = FALSE; if (pWin->mapped) diff --git a/composite/compint.h b/composite/compint.h index 625ce8dde5..8195ae0b8e 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -63,7 +63,6 @@ #include "privates.h" #include "mi.h" #include "damage.h" -#include "Xext/damage/damageextint.h" #include "xfixes.h" #include #include "compositeext.h"