summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2021-03-16 17:17:53 +0100
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-04-28 18:23:39 +0200
commit776734576c2ba7bd4bdba6e09bc5dad5e093670a (patch)
tree028b1e49034726bf3c26e3040af4dffad191312d /src/plugins/platforms/xcb
parentdd24b61d355cad2cbd29c82fc30b2335b059a187 (diff)
Call updateHighDpiScaling() on screenAdded()
QHighDpiScaling has two init/update functions: - initHighDpiScaling(): called once during QGuiApplication construction - updateHighDpiScaling(): called whenever (relevant) screen configuration changes Currently the calls to updateHighDpiScaling() are made from multiple places including platform code. Simplify by calling it from two locations: - QWindowSystemInterface::handleScreenAdded() - QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange() Replace comment about early calls to qt_defaultDpi with a test which calls qt_defaultDpiX/Y with no screens attached. (Looking at the qt_defaultDpiX() implementation, it is unlikely that there will be a problem as long as updateHighDpiScaling() is called before QGuiApplication::primaryScreen() starts returning a non-null value.) Change-Id: I447db42894617495843a5cb531a1322b000fed62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_screens.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
index 2e48826635..867bbef020 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
@@ -156,7 +156,6 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
screen = createScreen(virtualDesktop, output, outputInfo.get());
qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled";
}
- QHighDpiScaling::updateHighDpiScaling();
}
} else if (screen) {
if (output.crtc == XCB_NONE && output.mode == XCB_NONE) {