Use the factor() function for getting scale factors
Make the code less dependent on (changing) high-dpi internals. Change-Id: Ifc7cb4aab1c1c70016ca86639edf5c9630999f9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
733b653844
commit
ff52d95e29
@ -1392,7 +1392,7 @@ void QXcbWindow::propagateSizeHints()
|
|||||||
|
|
||||||
xcb_icccm_set_wm_normal_hints(xcb_connection(), m_window, &hints);
|
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()
|
void QXcbWindow::requestActivateWindow()
|
||||||
@ -1756,7 +1756,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
|
|||||||
// will make the comparison later.
|
// will make the comparison later.
|
||||||
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
|
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
|
||||||
|
|
||||||
if (!qFuzzyCompare(QHighDpiScaling::scaleAndOrigin(newScreen).factor, m_sizeHintsScaleFactor))
|
if (!qFuzzyCompare(QHighDpiScaling::factor(newScreen), m_sizeHintsScaleFactor))
|
||||||
propagateSizeHints();
|
propagateSizeHints();
|
||||||
|
|
||||||
// Send the synthetic expose event on resize only when the window is shrinked,
|
// Send the synthetic expose event on resize only when the window is shrinked,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user