mirror of https://github.com/AxioDL/boo.git
Use XRandR data to access DPI
This commit is contained in:
parent
abbd3167b2
commit
322c4d3aab
|
@ -998,10 +998,6 @@ public:
|
||||||
m_openGL = true;
|
m_openGL = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default screen */
|
|
||||||
Screen* screen = ScreenOfDisplay(display, defaultScreen);
|
|
||||||
m_pixelFactor = screen->width / (float)screen->mwidth / REF_DPMM;
|
|
||||||
|
|
||||||
XVisualInfo visTemplate;
|
XVisualInfo visTemplate;
|
||||||
visTemplate.screen = defaultScreen;
|
visTemplate.screen = defaultScreen;
|
||||||
int numVisuals;
|
int numVisuals;
|
||||||
|
@ -1018,6 +1014,7 @@ public:
|
||||||
XFree(visualList);
|
XFree(visualList);
|
||||||
|
|
||||||
/* Create colormap */
|
/* Create colormap */
|
||||||
|
Screen* screen = ScreenOfDisplay(display, defaultScreen);
|
||||||
m_colormapId = XCreateColormap(m_xDisp, screen->root, selectedVisual, AllocNone);
|
m_colormapId = XCreateColormap(m_xDisp, screen->root, selectedVisual, AllocNone);
|
||||||
|
|
||||||
/* Create window */
|
/* Create window */
|
||||||
|
@ -1025,9 +1022,15 @@ public:
|
||||||
int nmonitors = 0;
|
int nmonitors = 0;
|
||||||
XRRMonitorInfo* mInfo = XRRGetMonitors(m_xDisp, screen->root, true, &nmonitors);
|
XRRMonitorInfo* mInfo = XRRGetMonitors(m_xDisp, screen->root, true, &nmonitors);
|
||||||
if (nmonitors)
|
if (nmonitors)
|
||||||
|
{
|
||||||
genFrameDefault(mInfo, x, y, w, h);
|
genFrameDefault(mInfo, x, y, w, h);
|
||||||
|
m_pixelFactor = mInfo->width / (float)mInfo->mwidth / REF_DPMM;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
genFrameDefault(screen, x, y, w, h);
|
genFrameDefault(screen, x, y, w, h);
|
||||||
|
m_pixelFactor = screen->width / (float)screen->mwidth / REF_DPMM;
|
||||||
|
}
|
||||||
XRRFreeMonitors(mInfo);
|
XRRFreeMonitors(mInfo);
|
||||||
XSetWindowAttributes swa;
|
XSetWindowAttributes swa;
|
||||||
swa.colormap = m_colormapId;
|
swa.colormap = m_colormapId;
|
||||||
|
|
Loading…
Reference in New Issue