From ff52d95e2979a4a87cc975172f1eace1a7a65661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 31 Mar 2020 14:25:59 +0200 Subject: [PATCH] Use the factor() function for getting scale factors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the code less dependent on (changing) high-dpi internals. Change-Id: Ifc7cb4aab1c1c70016ca86639edf5c9630999f9e Reviewed-by: Tor Arne Vestbø Reviewed-by: Friedemann Kleint --- src/plugins/platforms/xcb/qxcbwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 224f0bd4cb..eba6cc0712 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1392,7 +1392,7 @@ void QXcbWindow::propagateSizeHints() xcb_icccm_set_wm_normal_hints(xcb_connection(), m_window, &hints); - m_sizeHintsScaleFactor = QHighDpiScaling::scaleAndOrigin(screen()).factor; + m_sizeHintsScaleFactor = QHighDpiScaling::factor(screen()); } void QXcbWindow::requestActivateWindow() @@ -1756,7 +1756,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * // will make the comparison later. QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); - if (!qFuzzyCompare(QHighDpiScaling::scaleAndOrigin(newScreen).factor, m_sizeHintsScaleFactor)) + if (!qFuzzyCompare(QHighDpiScaling::factor(newScreen), m_sizeHintsScaleFactor)) propagateSizeHints(); // Send the synthetic expose event on resize only when the window is shrinked,