Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set the mm in randr #334

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions module/rdpRandR.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ rdpRRAddOutput(rdpPtr dev, const char *aname)
/******************************************************************************/
static int
rdpRRConnectOutput(RROutputPtr output, RRCrtcPtr crtc,
int x, int y, int width, int height)
int x, int y, int width, int height,
int mmwidth, int mmheight)
{
RRModePtr mode;
xRRModeInfo modeInfo = {0};
Expand Down Expand Up @@ -456,6 +457,11 @@ rdpRRConnectOutput(RROutputPtr output, RRCrtcPtr crtc,
LLOGLN(0, ("rdpRRConnectOutput: RROutputSetConnection failed"));
return 1;
}
if (!RROutputSetPhysicalSize(output, mmwidth, mmheight))
{
LLOGLN(0, ("rdpRRConnectOutput: RROutputSetPhysicalSize failed"));
return 1;
}
RRCrtcNotify(crtc, mode, x, y, RR_Rotate_0, NULL, 1, &output);
return 0;
}
Expand Down Expand Up @@ -517,6 +523,8 @@ rdpRRSetRdpOutputs(rdpPtr dev)
int top;
int width;
int height;
int mmwidth;
int mmheight;
int rv = 0;

pRRScrPriv = rrGetScrPriv(dev->pScreen);
Expand Down Expand Up @@ -548,12 +556,15 @@ rdpRRSetRdpOutputs(rdpPtr dev)
top = 0;
width = dev->width;
height = dev->height;
mmwidth = dev->pScreen->mmWidth;
mmheight = dev->pScreen->mmHeight;
LLOGLN(0, ("rdpRRSetRdpOutputs: update output %d "
"left %d top %d width %d height %d",
0, left, top, width, height));
rv = rdpRRConnectOutput(pRRScrPriv->outputs[0],
pRRScrPriv->crtcs[0],
left, top, width, height);
left, top, width, height,
mmwidth, mmheight);
index = 1;
}
else
Expand All @@ -564,12 +575,15 @@ rdpRRSetRdpOutputs(rdpPtr dev)
top = dev->minfo[index].top;
width = dev->minfo[index].right - dev->minfo[index].left + 1;
height = dev->minfo[index].bottom - dev->minfo[index].top + 1;
mmwidth = dev->minfo[index].physical_width;
mmheight = dev->minfo[index].physical_height;
LLOGLN(0, ("rdpRRSetRdpOutputs: update output %d "
"left %d top %d width %d height %d",
index, left, top, width, height));
rv = rdpRRConnectOutput(pRRScrPriv->outputs[index],
pRRScrPriv->crtcs[index],
left, top, width, height);
left, top, width, height,
mmwidth, mmheight);
if ((rv == 0) && (dev->minfo[index].is_primary))
{
RRSetPrimaryOutput(pRRScrPriv, pRRScrPriv->outputs[index]);
Expand Down