Skip to content

Commit

Permalink
fix for using --enable-lrandr with XRDP_NVIDIA_GRID
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Jan 1, 2025
1 parent 4e43032 commit cd8457b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions module/rdpMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ static DriverRec g_saved_driver;
static OsTimerPtr g_timer = NULL;
static xf86PreInitProc *g_orgPreInit;
static xf86ScreenInitProc *g_orgScreenInit;
static Bool g_nvidia_grid = 0;

extern DriverPtr *xf86DriverList;
extern int xf86NumDrivers;
Expand All @@ -101,14 +102,23 @@ static Bool
xorgxrdpPreInit(ScrnInfoPtr pScrn, int flags)
{
Bool rv;
const char *env;

LLOGLN(0, ("xorgxrdpPreInit:"));
env = getenv("XRDP_NVIDIA_GRID");
if (env != NULL)
{
g_nvidia_grid = atoi(env);
}
rv = g_orgPreInit(pScrn, flags);
if (rv)
{
pScrn->reservedPtr[0] = xnfcalloc(sizeof(rdpRec), 1);
#if defined(RANDR) && defined(XORGXRDP_LRANDR)
noRRExtension = TRUE; /* do not use built in randr */
if (!g_nvidia_grid)
{
noRRExtension = TRUE; /* do not use built in randr */
}
#endif
}
return rv;
Expand Down Expand Up @@ -264,7 +274,10 @@ xorgxrdpDeferredStartup(OsTimerPtr timer, CARD32 now, pointer arg)
{
dev = rdpGetDevFromScreen(pScreen);
#if defined(XORGXRDP_LRANDR)
rdpLRRInit(dev);
if (!g_nvidia_grid)
{
rdpLRRInit(dev);
}
#endif
dev->damage = DamageCreate(xorgxrdpDamageReport, xorgxrdpDamageDestroy,
DamageReportRawRegion, TRUE,
Expand Down Expand Up @@ -307,7 +320,7 @@ xorgxrdpScreenInit(ScreenPtr pScreen, int argc, char** argv)
pScrn = xf86Screens[pScreen->myNum];
dev = XRDPPTR(pScrn);
dev->nvidia = TRUE;
dev->nvidia_grid = getenv("XRDP_NVIDIA_GRID") != NULL;
dev->nvidia_grid = g_nvidia_grid;
LLOGLN(0, ("xorgxrdpScreenInit: nvidia_grid %d", dev->nvidia_grid));
dev->pScreen = pScreen;
dev->depth = pScrn->depth;
Expand Down

0 comments on commit cd8457b

Please sign in to comment.