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

@@ -32,6 +32,7 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/rpcbuf_priv.h"
#include "dix/screenint_priv.h"
#include "Xext/xvdix_priv.h"
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
@@ -1543,7 +1544,7 @@ void
XineramifyXv(void)
{
XvScreenPtr xvsp0 =
dixLookupPrivate(&screenInfo.screens[0]->devPrivates, XvGetScreenKey());
dixLookupPrivate(&(dixGetFirstScreenPtr()->devPrivates), XvGetScreenKey());
XvAdaptorPtr MatchingAdaptors[MAXSCREENS];
int i;