summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfshooks_stub.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
index 91a97ff977..c334f46c2c 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
@@ -99,6 +99,7 @@ QSizeF QEglFSHooks::physicalScreenSize() const
struct fb_var_screeninfo vinfo;
int w = -1;
int h = -1;
+ QSize screenResolution;
if (framebuffer != -1) {
if (ioctl(framebuffer, FBIOGET_VSCREENINFO, &vinfo) == -1) {
@@ -106,12 +107,15 @@ QSizeF QEglFSHooks::physicalScreenSize() const
} else {
w = vinfo.width;
h = vinfo.height;
+ screenResolution = QSize(vinfo.xres, vinfo.yres);
}
+ } else {
+ screenResolution = screenSize();
}
const int defaultPhysicalDpi = 100;
- size.setWidth(w <= 0 ? vinfo.xres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w));
- size.setHeight(h <= 0 ? vinfo.yres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h));
+ size.setWidth(w <= 0 ? screenResolution.width() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w));
+ size.setHeight(h <= 0 ? screenResolution.height() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h));
if (w <= 0 || h <= 0) {
qWarning("EGLFS: Unable to query physical screen size, defaulting to %d dpi.\n"