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>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2020-09-16 15:25:27 +02:00
parent 1c60f6bc5e
commit f3ecac059d

View File

@ -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;