From f3ecac059d37f829f9379887584b565d3ac6c03e Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 16 Sep 2020 15:25:27 +0200 Subject: Fix running with placeholder screen and high-dpi enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/gui/kernel/qplatformscreen.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/kernel') 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 virtualSiblings() const override; -- cgit v1.2.3