View | Details | Raw Unified | Return to bug 7267
Collapse All | Expand All

(-)a/unix/x0vncserver/RandrGlue.c (-8 / +8 lines)
Lines 117-131 int vncRandRResizeScreen(int width, int height) Link Here
117
{
117
{
118
  vncGlueContext *ctx = &randrGlueContext;
118
  vncGlueContext *ctx = &randrGlueContext;
119
119
120
  int xwidth = DisplayWidth(ctx->dpy, DefaultScreen(ctx->dpy));
120
  int mwidth, mheight;
121
  int xheight = DisplayHeight(ctx->dpy, DefaultScreen(ctx->dpy));
122
  int xwidthmm = DisplayWidthMM(ctx->dpy, DefaultScreen(ctx->dpy));
123
  int xheightmm = DisplayHeightMM(ctx->dpy, DefaultScreen(ctx->dpy));
124
121
125
  /* Try to retain DPI when we resize */
122
  // Always calculate a DPI of 96.
126
  XRRSetScreenSize(ctx->dpy, DefaultRootWindow(ctx->dpy), width, height,
123
  // It's what mutter does, so good enough for us.
127
                   xwidthmm * width / xwidth,
124
  mwidth = width * 254 / 96 / 10;
128
                   xheightmm * height / xheight);
125
  mheight = height * 254 / 96 / 10;
126
127
  XRRSetScreenSize(ctx->dpy, DefaultRootWindow(ctx->dpy),
128
                   width, height, mwidth, mheight);
129
129
130
  return 1;
130
  return 1;
131
}
131
}
(-)a/unix/xserver/hw/vnc/RandrGlue.c (-4 / +7 lines)
Lines 64-74 int vncRandRIsValidScreenSize(int width, int height) Link Here
64
int vncRandRResizeScreen(int width, int height)
64
int vncRandRResizeScreen(int width, int height)
65
{
65
{
66
  ScreenPtr pScreen = screenInfo.screens[scrIdx];
66
  ScreenPtr pScreen = screenInfo.screens[scrIdx];
67
  int dpi, mwidth, mheight;
67
68
68
  /* Try to retain DPI when we resize */
69
  /* Keep the DPI specified at start */
69
  return RRScreenSizeSet(pScreen, width, height,
70
  dpi = monitorResolution ? monitorResolution : 96;
70
                         pScreen->mmWidth * width / pScreen->width,
71
  mwidth = width * 254 / dpi / 10;
71
                         pScreen->mmHeight * height / pScreen->height);
72
  mheight = height * 254 / dpi / 10;
73
74
  return RRScreenSizeSet(pScreen, width, height, mwidth, mheight);
72
}
75
}
73
76
74
void vncRandRUpdateSetTime(void)
77
void vncRandRUpdateSetTime(void)

Return to bug 7267