Compare commits

..

2 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 87c5b5bf42 xquartz: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 14:10:18 +02:00
Enrico Weigelt, metux IT consult 71a2617c28 xfixes: use calloc() instead of malloc()
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.

The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.

The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 14:10:18 +02:00
23 changed files with 64 additions and 104 deletions

View File

@ -11,6 +11,14 @@
#include "namespace.h" #include "namespace.h"
#include "hooks.h" #include "hooks.h"
static inline Bool winIsRoot(WindowPtr pWin) {
if (!pWin)
return FALSE;
if (pWin->drawable.pScreen->root == pWin)
return TRUE;
return FALSE;
}
void hookWindowProperty(CallbackListPtr *pcbl, void *unused, void *calldata) void hookWindowProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
{ {
XNS_HOOK_HEAD(PropertyFilterParam); XNS_HOOK_HEAD(PropertyFilterParam);

View File

@ -370,23 +370,6 @@ ddxProcessArgument(int argc, char **argv, int i)
return KdProcessArgument(argc, argv, i); return KdProcessArgument(argc, argv, i);
} }
static int
EphyrInit(void)
{
/*
* make sure at least one screen
* has been added to the system.
*/
if (!KdCardInfoLast()) {
processScreenArg("640x480", NULL);
}
return hostx_init();
}
KdOsFuncs EphyrOsFuncs = {
.Init = EphyrInit,
};
void void
OsVendorInit(void) OsVendorInit(void)
{ {
@ -398,7 +381,12 @@ OsVendorInit(void)
if (hostx_want_host_cursor()) if (hostx_want_host_cursor())
ephyrFuncs.initCursor = &ephyrCursorInit; ephyrFuncs.initCursor = &ephyrCursorInit;
KdOsInit(&EphyrOsFuncs); if (serverGeneration == 1) {
if (!KdCardInfoLast()) {
processScreenArg("640x480", NULL);
}
hostx_init();
}
} }
KdCardFuncs ephyrFuncs = { KdCardFuncs ephyrFuncs = {

View File

@ -91,14 +91,6 @@ const char *kdGlobalXkbLayout = NULL;
const char *kdGlobalXkbVariant = NULL; const char *kdGlobalXkbVariant = NULL;
const char *kdGlobalXkbOptions = NULL; const char *kdGlobalXkbOptions = NULL;
/*
* Carry arguments from InitOutput through driver initialization
* to KdScreenInit
*/
KdOsFuncs *kdOsFuncs = NULL;
void void
KdDisableScreen(ScreenPtr pScreen) KdDisableScreen(ScreenPtr pScreen)
{ {
@ -525,19 +517,6 @@ KdProcessArgument(int argc, char **argv, int i)
return 0; return 0;
} }
void
KdOsInit(KdOsFuncs * pOsFuncs)
{
kdOsFuncs = pOsFuncs;
if (pOsFuncs) {
if (serverGeneration == 1) {
KdDoSwitchCmd("start");
if (pOsFuncs->Init)
(*pOsFuncs->Init) ();
}
}
}
static Bool static Bool
KdAllocatePrivates(ScreenPtr pScreen) KdAllocatePrivates(ScreenPtr pScreen)
{ {

View File

@ -278,16 +278,6 @@ int KdAddConfigKeyboard(char *pointer);
int KdAddKeyboard(KdKeyboardInfo * ki); int KdAddKeyboard(KdKeyboardInfo * ki);
void KdRemoveKeyboard(KdKeyboardInfo * ki); void KdRemoveKeyboard(KdKeyboardInfo * ki);
typedef struct _KdOsFuncs {
int (*Init) (void); /* Only called when the X server is started, when serverGeneration == 1 */
void (*Enable) (void);
Bool (*SpecialKey) (KeySym);
void (*Disable) (void);
void (*Fini) (void);
void (*pollEvents) (void);
void (*Bell) (int, int, int);
} KdOsFuncs;
typedef struct _KdPointerMatrix { typedef struct _KdPointerMatrix {
int matrix[2][3]; int matrix[2][3];
} KdPointerMatrix; } KdPointerMatrix;
@ -299,8 +289,6 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
extern Bool kdEmulateMiddleButton; extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod; extern Bool kdDisableZaphod;
extern KdOsFuncs *kdOsFuncs;
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \ #define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey)) dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
#define KdSetScreenPriv(pScreen,v) \ #define KdSetScreenPriv(pScreen,v) \
@ -357,9 +345,6 @@ void
int int
KdProcessArgument(int argc, char **argv, int i); KdProcessArgument(int argc, char **argv, int i);
void
KdOsInit(KdOsFuncs * pOsFuncs);
void void
KdOsAddInputDrivers(void); KdOsAddInputDrivers(void);

View File

@ -259,6 +259,13 @@ ddxGiveUp(enum ExitCode error)
} }
} }
#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
{
}
#endif
void void
OsVendorInit(void) OsVendorInit(void)
{ {

View File

@ -154,6 +154,13 @@ ddxGiveUp(enum ExitCode error)
xnestCloseDisplay(); xnestCloseDisplay();
} }
#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
{
}
#endif
void void
OsVendorInit(void) OsVendorInit(void)
{ {

View File

@ -549,7 +549,7 @@ getGlCapabilities(struct glCapabilities *cap)
continue; continue;
} }
conf = malloc(sizeof(*conf)); conf = calloc(1, sizeof(*conf));
if (NULL == conf) { if (NULL == conf) {
FatalError("Unable to allocate memory for OpenGL capabilities\n"); FatalError("Unable to allocate memory for OpenGL capabilities\n");
} }

View File

@ -44,21 +44,12 @@
#if defined(IN_MINI_GLX) #if defined(IN_MINI_GLX)
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#define _mesa_malloc(b) malloc(b)
#define _mesa_free(m) free(m)
#define _mesa_memset memset
#else #else
#ifdef XFree86Server #ifdef XFree86Server
#include <os.h> #include <os.h>
#include <string.h> #include <string.h>
#define _mesa_malloc(b) malloc(b)
#define _mesa_free(m) free(m)
#define _mesa_memset memset
#else #else
#include <X11/Xlibint.h> #include <X11/Xlibint.h>
#define _mesa_memset memset
#define _mesa_malloc(b) Xmalloc(b)
#define _mesa_free(m) free(m)
#endif /* XFree86Server */ #endif /* XFree86Server */
#endif /* !defined(IN_MINI_GLX) */ #endif /* !defined(IN_MINI_GLX) */
@ -129,7 +120,7 @@ _gl_copy_visual_to_context_mode(__GLcontextModes * mode,
{ {
__GLcontextModes * const next = mode->next; __GLcontextModes * const next = mode->next;
(void)_mesa_memset(mode, 0, sizeof(__GLcontextModes)); (void)memset(mode, 0, sizeof(__GLcontextModes));
mode->next = next; mode->next = next;
mode->visualID = config->vid; mode->visualID = config->vid;
@ -431,14 +422,14 @@ _gl_context_modes_create(unsigned count, size_t minimum_size)
next = &base; next = &base;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
*next = (__GLcontextModes *)_mesa_malloc(size); *next = calloc(1, size);
if (*next == NULL) { if (*next == NULL) {
_gl_context_modes_destroy(base); _gl_context_modes_destroy(base);
base = NULL; base = NULL;
break; break;
} }
(void)_mesa_memset(*next, 0, size); (void)memset(*next, 0, size);
(*next)->visualID = GLX_DONT_CARE; (*next)->visualID = GLX_DONT_CARE;
(*next)->visualType = GLX_DONT_CARE; (*next)->visualType = GLX_DONT_CARE;
(*next)->visualRating = GLX_NONE; (*next)->visualRating = GLX_NONE;
@ -476,7 +467,7 @@ _gl_context_modes_destroy(__GLcontextModes * modes)
while (modes != NULL) { while (modes != NULL) {
__GLcontextModes * const next = modes->next; __GLcontextModes * const next = modes->next;
_mesa_free(modes); free(modes);
modes = next; modes = next;
} }
} }

View File

@ -549,10 +549,7 @@ __glXAquaScreenCreateDrawable(ClientPtr client,
XID glxDrawId, XID glxDrawId,
__GLXconfig *conf) __GLXconfig *conf)
{ {
__GLXAquaDrawable *glxPriv; __GLXAquaDrawable *glxPriv = calloc(1, sizeof *glxPriv);
glxPriv = malloc(sizeof *glxPriv);
if (glxPriv == NULL) if (glxPriv == NULL)
return NULL; return NULL;

View File

@ -224,7 +224,7 @@ static int
ProcAppleWMSelectInput(register ClientPtr client) ProcAppleWMSelectInput(register ClientPtr client)
{ {
REQUEST(xAppleWMSelectInputReq); REQUEST(xAppleWMSelectInputReq);
WMEventPtr pEvent, pNewEvent, *pHead; WMEventPtr pEvent, *pHead;
XID clientResource; XID clientResource;
int i; int i;
@ -246,7 +246,7 @@ ProcAppleWMSelectInput(register ClientPtr client)
} }
/* build the entry */ /* build the entry */
pNewEvent = (WMEventPtr)malloc(sizeof(WMEventRec)); WMEventPtr pNewEvent = calloc(1, sizeof(WMEventRec));
if (!pNewEvent) if (!pNewEvent)
return BadAlloc; return BadAlloc;
pNewEvent->next = 0; pNewEvent->next = 0;
@ -267,7 +267,7 @@ ProcAppleWMSelectInput(register ClientPtr client)
* done through the resource database. * done through the resource database.
*/ */
if (i != Success || !pHead) { if (i != Success || !pHead) {
pHead = (WMEventPtr *)malloc(sizeof(WMEventPtr)); pHead = calloc(1, sizeof(WMEventPtr));
if (!pHead || if (!pHead ||
!AddResource(eventResource, EventType, (void *)pHead)) { !AddResource(eventResource, EventType, (void *)pHead)) {
FreeResource(clientResource, X11_RESTYPE_NONE); FreeResource(clientResource, X11_RESTYPE_NONE);
@ -368,16 +368,15 @@ ProcAppleWMReenableUpdate(register ClientPtr client)
static int static int
ProcAppleWMSetWindowMenu(register ClientPtr client) ProcAppleWMSetWindowMenu(register ClientPtr client)
{ {
const char *bytes, **items; const char *bytes;
char *shortcuts;
int max_len, nitems, i, j; int max_len, nitems, i, j;
REQUEST(xAppleWMSetWindowMenuReq); REQUEST(xAppleWMSetWindowMenuReq);
REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq); REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq);
nitems = stuff->nitems; nitems = stuff->nitems;
items = malloc(sizeof(char *) * nitems); const char **items = calloc(nitems, sizeof(char *));
shortcuts = malloc(sizeof(char) * nitems); char *shortcuts = calloc(nitems, sizeof(char));
if (!items || !shortcuts) { if (!items || !shortcuts) {
free(items); free(items);
@ -690,6 +689,7 @@ SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to)
static int static int
SProcAppleWMQueryVersion(register ClientPtr client) SProcAppleWMQueryVersion(register ClientPtr client)
{ {
REQUEST(xAppleWMQueryVersionReq);
return ProcAppleWMQueryVersion(client); return ProcAppleWMQueryVersion(client);
} }

View File

@ -188,7 +188,6 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
int dpi; int dpi;
static int foundIndex = 0; static int foundIndex = 0;
Bool ret; Bool ret;
DarwinFramebufferPtr dfb;
if (!dixRegisterPrivateKey(&darwinScreenKeyRec, PRIVATE_SCREEN, 0)) if (!dixRegisterPrivateKey(&darwinScreenKeyRec, PRIVATE_SCREEN, 0))
return FALSE; return FALSE;
@ -202,7 +201,7 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
} }
// allocate space for private per screen storage // allocate space for private per screen storage
dfb = malloc(sizeof(DarwinFramebufferRec)); DarwinFramebufferPtr dfb = calloc(1, sizeof(DarwinFramebufferRec));
// SCREEN_PRIV(pScreen) = dfb; // SCREEN_PRIV(pScreen) = dfb;
dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb); dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb);

View File

@ -879,7 +879,7 @@ ucs2keysym(long ucs)
int mid; int mid;
if (reverse_keysymtab == NULL) { if (reverse_keysymtab == NULL) {
reverse_keysymtab = malloc(sizeof(keysymtab)); reverse_keysymtab = calloc(1, sizeof(keysymtab));
memcpy(reverse_keysymtab, keysymtab, sizeof(keysymtab)); memcpy(reverse_keysymtab, keysymtab, sizeof(keysymtab));
qsort(reverse_keysymtab, qsort(reverse_keysymtab,

View File

@ -321,11 +321,9 @@ static int launchd_socket_handed_off = 0;
kern_return_t kern_return_t
do_request_fd_handoff_socket(mach_port_t port, string_t filename) do_request_fd_handoff_socket(mach_port_t port, string_t filename)
{ {
socket_handoff_t *handoff_data;
launchd_socket_handed_off = 1; launchd_socket_handed_off = 1;
handoff_data = (socket_handoff_t *)calloc(1, sizeof(socket_handoff_t)); socket_handoff_t *handoff_data = calloc(1, sizeof(socket_handoff_t));
if (!handoff_data) { if (!handoff_data) {
ErrorF("X11.app: Error allocating memory for handoff_data\n"); ErrorF("X11.app: Error allocating memory for handoff_data\n");
return KERN_FAILURE; return KERN_FAILURE;
@ -528,7 +526,6 @@ setup_console_redirect(const char *bundle_id)
static void static void
setup_env(void) setup_env(void)
{ {
char *temp;
const char *pds = NULL; const char *pds = NULL;
const char *disp = getenv("DISPLAY"); const char *disp = getenv("DISPLAY");
size_t len; size_t len;
@ -559,7 +556,7 @@ setup_env(void)
setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1); setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1);
len = strlen(server_bootstrap_name); len = strlen(server_bootstrap_name);
bundle_id_prefix = malloc(sizeof(char) * (len - 3)); bundle_id_prefix = calloc(len-3, sizeof(char));
if (!bundle_id_prefix) { if (!bundle_id_prefix) {
ErrorF("X11.app: Memory allocation error.\n"); ErrorF("X11.app: Memory allocation error.\n");
exit(1); exit(1);
@ -582,7 +579,7 @@ setup_env(void)
"X11.app: Detected old style launchd DISPLAY, please update xinit.\n"); "X11.app: Detected old style launchd DISPLAY, please update xinit.\n");
} }
else { else {
temp = (char *)malloc(sizeof(char) * len); char *temp = calloc(len, sizeof(char));
if (!temp) { if (!temp) {
ErrorF( ErrorF(
"X11.app: Memory allocation error creating space for socket name test.\n"); "X11.app: Memory allocation error creating space for socket name test.\n");
@ -613,7 +610,7 @@ setup_env(void)
ensure_path(X11BINDIR); ensure_path(X11BINDIR);
/* cd $HOME */ /* cd $HOME */
temp = getenv("HOME"); char *temp = getenv("HOME");
if (temp != NULL && temp[0] != '\0') if (temp != NULL && temp[0] != '\0')
chdir(temp); chdir(temp);
} }
@ -781,14 +778,14 @@ command_from_prefs(const char *key, const char *default_value)
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
CFRelease(cfDefaultValue); CFRelease(cfDefaultValue);
command = (char *)malloc(len * sizeof(char)); command = calloc(len, sizeof(char));
if (!command) if (!command)
goto command_from_prefs_out; goto command_from_prefs_out;
strcpy(command, default_value); strcpy(command, default_value);
} }
else { else {
int len = CFStringGetLength((CFStringRef)PlistRef) + 1; int len = CFStringGetLength((CFStringRef)PlistRef) + 1;
command = (char *)malloc(len * sizeof(char)); command = calloc(len, sizeof(char));
if (!command) if (!command)
goto command_from_prefs_out; goto command_from_prefs_out;
CFStringGetCString((CFStringRef)PlistRef, command, len, CFStringGetCString((CFStringRef)PlistRef, command, len,

View File

@ -50,7 +50,7 @@
* needs and simply execs the startup script which then execs the main binary. * needs and simply execs the startup script which then execs the main binary.
*/ */
static char *executable_path(void) { static char *executable_path() {
uint32_t bufsize = PATH_MAX; uint32_t bufsize = PATH_MAX;
char *buf = calloc(1, bufsize); char *buf = calloc(1, bufsize);

View File

@ -532,7 +532,7 @@ QuartzCopyDisplayIDs(ScreenPtr pScreen,
free(pQuartzScreen->displayIDs); free(pQuartzScreen->displayIDs);
if (displayCount) { if (displayCount) {
size_t size = displayCount * sizeof(CGDirectDisplayID); size_t size = displayCount * sizeof(CGDirectDisplayID);
pQuartzScreen->displayIDs = malloc(size); pQuartzScreen->displayIDs = calloc(1, size);
memcpy(pQuartzScreen->displayIDs, displayIDs, size); memcpy(pQuartzScreen->displayIDs, displayIDs, size);
} }
else { else {

View File

@ -81,7 +81,7 @@ create_thread(void *func, void *arg)
void void
QuartzInitServer(int argc, char **argv, char **envp) QuartzInitServer(int argc, char **argv, char **envp)
{ {
struct arg *args = (struct arg *)malloc(sizeof(struct arg)); struct arg *args = calloc(1, sizeof(struct arg));
if (!args) if (!args)
FatalError("Could not allocate memory.\n"); FatalError("Could not allocate memory.\n");

View File

@ -394,6 +394,7 @@ SNotifyEvent(xAppleDRINotifyEvent *from,
static int static int
SProcAppleDRIQueryVersion(register ClientPtr client) SProcAppleDRIQueryVersion(register ClientPtr client)
{ {
REQUEST(xAppleDRIQueryVersionReq);
return ProcAppleDRIQueryVersion(client); return ProcAppleDRIQueryVersion(client);
} }

View File

@ -265,7 +265,7 @@ CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin,
xp_window_changes wc; xp_window_changes wc;
/* allocate a DRI Window Private record */ /* allocate a DRI Window Private record */
if (!(pDRIDrawablePriv = malloc(sizeof(*pDRIDrawablePriv)))) { if (!(pDRIDrawablePriv = calloc(1, sizeof(*pDRIDrawablePriv)))) {
return NULL; return NULL;
} }
@ -681,7 +681,6 @@ DRICreatePixmap(ScreenPtr pScreen, Drawable id,
DrawablePtr pDrawable, char *path, DrawablePtr pDrawable, char *path,
size_t pathmax) size_t pathmax)
{ {
DRIPixmapBufferPtr shared;
PixmapPtr pPix; PixmapPtr pPix;
if (pDrawable->type != DRAWABLE_PIXMAP) if (pDrawable->type != DRAWABLE_PIXMAP)
@ -689,7 +688,7 @@ DRICreatePixmap(ScreenPtr pScreen, Drawable id,
pPix = (PixmapPtr)pDrawable; pPix = (PixmapPtr)pDrawable;
shared = malloc(sizeof(*shared)); DRIPixmapBufferPtr shared = calloc(1, sizeof(*shared));
if (NULL == shared) { if (NULL == shared) {
FatalError("failed to allocate DRIPixmapBuffer in %s\n", __func__); FatalError("failed to allocate DRIPixmapBuffer in %s\n", __func__);
} }

View File

@ -90,7 +90,7 @@ X_PFX(list_prepend) (x_list * lst, void *data) {
x_list_block *b; x_list_block *b;
int i; int i;
b = malloc(sizeof(x_list_block)); b = calloc(1, sizeof(x_list_block));
assert(b != NULL); assert(b != NULL);
for (i = 0; i < NODES_PER_BLOCK - 1; i++) for (i = 0; i < NODES_PER_BLOCK - 1; i++)

View File

@ -93,7 +93,7 @@ load_cursor(CursorPtr src, int screen)
const uint32_t *be_data = (uint32_t *)src->bits->argb; const uint32_t *be_data = (uint32_t *)src->bits->argb;
unsigned i; unsigned i;
rowbytes = src->bits->width * sizeof(CARD32); rowbytes = src->bits->width * sizeof(CARD32);
data = malloc(rowbytes * src->bits->height); data = calloc(src->bits->height, rowbytes);
free_data = TRUE; free_data = TRUE;
if (!data) { if (!data) {
FatalError("Failed to allocate memory in %s\n", __func__); FatalError("Failed to allocate memory in %s\n", __func__);
@ -119,7 +119,7 @@ load_cursor(CursorPtr src, int screen)
/* round up to 8 pixel boundary so we can convert whole bytes */ /* round up to 8 pixel boundary so we can convert whole bytes */
rowbytes = ((src->bits->width * 4) + 31) & ~31; rowbytes = ((src->bits->width * 4) + 31) & ~31;
data = malloc(rowbytes * src->bits->height); data = calloc(src->bits->height, rowbytes);
free_data = TRUE; free_data = TRUE;
if (!data) { if (!data) {
FatalError("Failed to allocate memory in %s\n", __func__); FatalError("Failed to allocate memory in %s\n", __func__);

View File

@ -198,7 +198,7 @@ static void
xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height, xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height,
ScreenPtr pScreen) ScreenPtr pScreen)
{ {
CGDisplayCount i, displayCount; CGDisplayCount i;
CGDirectDisplayID *displayList = NULL; CGDirectDisplayID *displayList = NULL;
CGRect unionRect = CGRectNull, frame; CGRect unionRect = CGRectNull, frame;
@ -224,7 +224,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height,
if (CGDisplayIsCaptured(kCGDirectMainDisplay)) if (CGDisplayIsCaptured(kCGDirectMainDisplay))
displayCount = 1; displayCount = 1;
displayList = malloc(displayCount * sizeof(CGDirectDisplayID)); CGDisplayCount displayList = calloc(displayCount, sizeof(CGDirectDisplayID));
if (!displayList) if (!displayList)
FatalError("Unable to allocate memory for list of displays.\n"); FatalError("Unable to allocate memory for list of displays.\n");
CGGetActiveDisplayList(displayCount, displayList, &displayCount); CGGetActiveDisplayList(displayCount, displayList, &displayCount);

View File

@ -3,10 +3,10 @@ project('xserver', 'c',
'buildtype=debugoptimized', 'buildtype=debugoptimized',
'c_std=gnu99', 'c_std=gnu99',
], ],
version: '25.0.0.4', version: '25.0.0.3',
meson_version: '>= 0.58.0', meson_version: '>= 0.58.0',
) )
release_date = '2025-07-04' release_date = '2025-07-02'
add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc']) add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc'])
cc = meson.get_compiler('c') cc = meson.get_compiler('c')

View File

@ -1040,6 +1040,8 @@ XFixesCursorInit(void)
for (i = 0; i < screenInfo.numScreens; i++) { for (i = 0; i < screenInfo.numScreens; i++) {
ScreenPtr pScreen = screenInfo.screens[i]; ScreenPtr pScreen = screenInfo.screens[i];
CursorScreenPtr cs = GetCursorScreen(pScreen); CursorScreenPtr cs = GetCursorScreen(pScreen);
if (!cs)
return FALSE;
dixScreenHookClose(pScreen, CursorScreenClose); dixScreenHookClose(pScreen, CursorScreenClose);
Wrap(cs, pScreen, DisplayCursor, CursorDisplayCursor); Wrap(cs, pScreen, DisplayCursor, CursorDisplayCursor);
cs->pCursorHideCounts = NULL; cs->pCursorHideCounts = NULL;