Bugzilla – Attachment 953 Details for
Bug 7267
Xvnc DPI increases slowly on resize
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Suggested patch
dpi.patch (text/plain), 2.32 KB, created by
Pierre Ossman
on 2020-05-14 18:08:24 CEST
(
hide
)
Description:
Suggested patch
Filename:
MIME Type:
Creator:
Pierre Ossman
Created:
2020-05-14 18:08:24 CEST
Size:
2.32 KB
patch
obsolete
>commit 39885eb71eb4eeaea45e3a1e7e0ead77e1ec2ec1 >Author: Pierre Ossman <ossman@cendio.se> >Date: Thu Nov 1 10:19:15 2018 +0100 > > Maintain static screen DPI on resize > > Trying to dynamically track the DPI did not really work as we'd > start accumulating errors and eventually the DPI would start to > drift. Instead maintain a fixed, sensible DPI at all times. > >diff --git a/unix/x0vncserver/RandrGlue.c b/unix/x0vncserver/RandrGlue.c >index ff12902f..c26ac6ad 100644 >--- a/unix/x0vncserver/RandrGlue.c >+++ b/unix/x0vncserver/RandrGlue.c >@@ -117,15 +117,15 @@ int vncRandRResizeScreen(int width, int height) > { > vncGlueContext *ctx = &randrGlueContext; > >- int xwidth = DisplayWidth(ctx->dpy, DefaultScreen(ctx->dpy)); >- int xheight = DisplayHeight(ctx->dpy, DefaultScreen(ctx->dpy)); >- int xwidthmm = DisplayWidthMM(ctx->dpy, DefaultScreen(ctx->dpy)); >- int xheightmm = DisplayHeightMM(ctx->dpy, DefaultScreen(ctx->dpy)); >+ int mwidth, mheight; > >- /* Try to retain DPI when we resize */ >- XRRSetScreenSize(ctx->dpy, DefaultRootWindow(ctx->dpy), width, height, >- xwidthmm * width / xwidth, >- xheightmm * height / xheight); >+ // Always calculate a DPI of 96. >+ // It's what mutter does, so good enough for us. >+ mwidth = width * 254 / 96 / 10; >+ mheight = height * 254 / 96 / 10; >+ >+ XRRSetScreenSize(ctx->dpy, DefaultRootWindow(ctx->dpy), >+ width, height, mwidth, mheight); > > return 1; > } >diff --git a/unix/xserver/hw/vnc/RandrGlue.c b/unix/xserver/hw/vnc/RandrGlue.c >index 82e85524..a2916888 100644 >--- a/unix/xserver/hw/vnc/RandrGlue.c >+++ b/unix/xserver/hw/vnc/RandrGlue.c >@@ -64,11 +64,14 @@ int vncRandRIsValidScreenSize(int width, int height) > int vncRandRResizeScreen(int width, int height) > { > ScreenPtr pScreen = screenInfo.screens[scrIdx]; >+ int dpi, mwidth, mheight; > >- /* Try to retain DPI when we resize */ >- return RRScreenSizeSet(pScreen, width, height, >- pScreen->mmWidth * width / pScreen->width, >- pScreen->mmHeight * height / pScreen->height); >+ /* Keep the DPI specified at start */ >+ dpi = monitorResolution ? monitorResolution : 96; >+ mwidth = width * 254 / dpi / 10; >+ mheight = height * 254 / dpi / 10; >+ >+ return RRScreenSizeSet(pScreen, width, height, mwidth, mheight); > } > > void vncRandRUpdateSetTime(void)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 7267
: 953