'-dpi' fixes for Xephyr
This commit is contained in:
parent
16ff3a8727
commit
7c0aaa53bf
|
@ -83,8 +83,9 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
|
|||
screen->height = height;
|
||||
}
|
||||
|
||||
screen->width_mm = screen->width * hostx_mm_per_pixel_horizontal();
|
||||
screen->height_mm = screen->height * hostx_mm_per_pixel_vertical();
|
||||
|
||||
if (screen->fb[0].depth && screen->fb[0].depth != hostx_get_depth())
|
||||
ErrorF("\nXephyr screen depth must match hosts, ignoring.\n");
|
||||
|
||||
screen->fb[0].depth = hostx_get_depth();
|
||||
screen->rate = 72;
|
||||
|
@ -346,8 +347,9 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
|
|||
RRRegisterSize (pScreen,
|
||||
sizes[n].width,
|
||||
sizes[n].height,
|
||||
sizes[n].width * hostx_mm_per_pixel_horizontal(),
|
||||
sizes[n].height * hostx_mm_per_pixel_vertical());
|
||||
(sizes[n].width * screen->width_mm)/screen->width,
|
||||
(sizes[n].height *screen->height_mm)/screen->height
|
||||
);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,8 +57,6 @@ struct EphyrHostXVars
|
|||
int depth;
|
||||
XImage *ximg;
|
||||
int win_width, win_height;
|
||||
double mm_per_pixel_vertical, mm_per_pixel_horizontal;
|
||||
|
||||
Bool use_host_cursor;
|
||||
Bool have_shm;
|
||||
long damage_debug_nsec;
|
||||
|
@ -78,6 +76,7 @@ extern int kdMaxScanCode;
|
|||
extern int kdMinKeyCode;
|
||||
extern int kdMaxKeyCode;
|
||||
extern int kdKeymapWidth;
|
||||
extern int monitorResolution;
|
||||
|
||||
/* X Error traps */
|
||||
|
||||
|
@ -189,11 +188,13 @@ hostx_init(void)
|
|||
HostX.depth = DefaultDepth(HostX.dpy, HostX.screen);
|
||||
HostX.visual = DefaultVisual(HostX.dpy, HostX.screen);
|
||||
|
||||
/* old way of getting dpi
|
||||
HostX.mm_per_pixel_vertical = (double)DisplayHeightMM(HostX.dpy, HostX.screen)
|
||||
/ DisplayHeight(HostX.dpy, HostX.screen);
|
||||
|
||||
HostX.mm_per_pixel_horizontal = (double)DisplayWidthMM(HostX.dpy, HostX.screen)
|
||||
/ DisplayWidth(HostX.dpy, HostX.screen);
|
||||
*/
|
||||
|
||||
if (HostX.win_pre_existing != None)
|
||||
{
|
||||
|
@ -321,18 +322,6 @@ hostx_get_visual_masks (unsigned long *rmsk,
|
|||
*bmsk = HostX.visual->blue_mask;
|
||||
}
|
||||
|
||||
double
|
||||
hostx_mm_per_pixel_vertical(void)
|
||||
{
|
||||
return HostX.mm_per_pixel_vertical;
|
||||
}
|
||||
|
||||
double
|
||||
hostx_mm_per_pixel_horizontal(void)
|
||||
{
|
||||
return HostX.mm_per_pixel_horizontal;
|
||||
}
|
||||
|
||||
|
||||
void*
|
||||
hostx_screen_init (int width, int height)
|
||||
|
|
|
@ -111,12 +111,6 @@ hostx_get_visual_masks (unsigned long *rmsk,
|
|||
unsigned long *gmsk,
|
||||
unsigned long *bmsk);
|
||||
|
||||
double
|
||||
hostx_mm_per_pixel_vertical(void);
|
||||
|
||||
double
|
||||
hostx_mm_per_pixel_horizontal(void);
|
||||
|
||||
void*
|
||||
hostx_screen_init (int width, int height);
|
||||
|
||||
|
|
Loading…
Reference in New Issue