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

@@ -25,6 +25,8 @@
#define XK_LATIN1
#include <X11/keysymdef.h>
#include "dix/screenint_priv.h"
#include "misc.h"
#include "scrnintstr.h"
#include "os.h"
@@ -329,7 +331,7 @@ SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params,
if (pPicture->pDrawable != NULL)
pScreen = pPicture->pDrawable->pScreen;
else
pScreen = screenInfo.screens[0];
pScreen = dixGetFirstScreenPtr();
pFilter = PictureFindFilter(pScreen, name, len);
@@ -360,7 +362,7 @@ SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
if (pPicture->pDrawable)
pScreen = pPicture->pDrawable->pScreen;
else
pScreen = screenInfo.screens[0];
pScreen = dixGetFirstScreenPtr();
if (pFilter->ValidateParams) {
int width, height;