treewide: use inline helper for accessing first screen

Instead of everybody directly accessing the (internal) screenInfo struct,
let those consumers only interested in first screen use a little helper.

Also caching the value if it's needed several times.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-09-03 13:35:03 +02:00
committed by Enrico Weigelt
parent d0a155c824
commit 6bc438ab5a
28 changed files with 227 additions and 147 deletions

View File

@@ -49,6 +49,7 @@
#include "dix/input_priv.h"
#include "dix/rpcbuf_priv.h"
#include "dix/screen_hooks_priv.h"
#include "dix/screenint_priv.h"
#include "xfixesint.h"
#include "scrnintstr.h"
@@ -618,7 +619,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure)
}
}
/* this "knows" that WindowHasNewCursor doesn't depend on its argument */
WindowHasNewCursor(screenInfo.screens[0]->root);
WindowHasNewCursor(dixGetFirstScreenPtr()->root);
}
static Bool