summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-09-16 15:25:27 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-09-18 07:44:22 +0200
commitf3ecac059d37f829f9379887584b565d3ac6c03e (patch)
tree77ed0288a12f45b633b8b72f9b6ec49743bf9825
parent1c60f6bc5e9539a297e9fe6ee583fa7b882f190e (diff)
Fix running with placeholder screen and high-dpi enabled
After we started defaulting to high-dpi enabled, it was discovered that it does not work correctly with the placeholder screen. Since the placeholder screen has no physical size, and the default implementation of logicalDpi() divides by the physical size, we got a scale factor of NaN in the high-dpi code. The effect of this was that the nooutput test in Qt Wayland would fail, because it did not get the events it was expecting, since the window geometry was never set to a valid rect in the resize() call. Task-number: QTBUG-86698 Change-Id: I7ee68db9a13446b414502ae0f26fd214531c673a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/gui/kernel/qplatformscreen.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h
index 32ad047147..68dab50ea5 100644
--- a/src/gui/kernel/qplatformscreen.h
+++ b/src/gui/kernel/qplatformscreen.h
@@ -187,6 +187,7 @@ public:
bool isPlaceholder() const override { return true; }
QRect geometry() const override { return QRect(); }
QRect availableGeometry() const override { return QRect(); }
+ QDpi logicalDpi() const override { return QDpi(72, 72); }
int depth() const override { return 32; }
QImage::Format format() const override { return QImage::Format::Format_RGB32; }
QList<QPlatformScreen *> virtualSiblings() const override;