Xnest: fetch display size from xcb setup data

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-08 17:51:57 +02:00
parent 2ec930fc4a
commit ba26d6bd90
2 changed files with 7 additions and 7 deletions

View File

@ -159,10 +159,10 @@ xnestOpenDisplay(int argc, char *argv[])
if (xnestParentWindow == 0) { if (xnestParentWindow == 0) {
if (!(xnestUserGeometry & WidthValue)) if (!(xnestUserGeometry & WidthValue))
xnestWidth = 3 * DisplayWidth(xnestDisplay, xnestUpstreamInfo.screenId) / 4; xnestWidth = 3 * xnestUpstreamInfo.screenInfo->width_in_pixels / 4;
if (!(xnestUserGeometry & HeightValue)) if (!(xnestUserGeometry & HeightValue))
xnestHeight = 3 * DisplayHeight(xnestDisplay, xnestUpstreamInfo.screenId) / 4; xnestHeight = 3 * xnestUpstreamInfo.screenInfo->height_in_pixels / 4;
} }
if (!xnestUserBorderWidth) if (!xnestUserBorderWidth)

View File

@ -322,12 +322,12 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
&xnestCursorFuncs); &xnestCursorFuncs);
PointPriv->spriteFuncs = &xnestPointerSpriteFuncs; PointPriv->spriteFuncs = &xnestPointerSpriteFuncs;
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay, xnestUpstreamInfo.screenId) pScreen->mmWidth =
/ DisplayWidth(xnestDisplay, xnestUpstreamInfo.screenId); xnestWidth * xnestUpstreamInfo.screenInfo->width_in_millimeters /
xnestUpstreamInfo.screenInfo->width_in_pixels;
pScreen->mmHeight = pScreen->mmHeight =
xnestHeight * DisplayHeightMM(xnestDisplay, xnestHeight * xnestUpstreamInfo.screenInfo->height_in_millimeters /
xnestUpstreamInfo.screenId) / xnestUpstreamInfo.screenInfo->height_in_pixels;
DisplayHeight(xnestDisplay, xnestUpstreamInfo.screenId);
/* overwrite miCloseScreen with our own */ /* overwrite miCloseScreen with our own */
pScreen->CloseScreen = xnestCloseScreen; pScreen->CloseScreen = xnestCloseScreen;