summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp8
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp4
2 files changed, 8 insertions, 4 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"
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index cd92a07f00..98c54e0ee0 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -68,11 +68,11 @@ QEglFSWindow::~QEglFSWindow()
void QEglFSWindow::create()
{
- setWindowState(Qt::WindowFullScreen);
-
if (m_window)
return;
+ setWindowState(Qt::WindowFullScreen);
+
if (window()->type() == Qt::Desktop) {
QRect rect(QPoint(), QEglFSHooks::hooks()->screenSize());
QPlatformWindow::setGeometry(rect);