When changing screen, only update the font if dpi has changed

Generally, this might avoid unnecessary work in a quite common case.

But if high dpi scaling is set, the dpi (in logical pixels) does
not change. However this event is sent before
QGuiApplicationPrivate::processWindowScreenChangedEvent has had
time to change the geometry, and might cause a problem in QMenu

Amends f3a4b4258f.

Task-number: QTBUG-59484
Change-Id: Ie4ceedcb0754613cf239ae86b225c4139b70d0cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
bb10
Olivier Goffart 2017-03-15 10:56:17 +01:00 committed by Olivier Goffart (Woboq GmbH)
parent 93a4bf5c8b
commit 7eeb88a5cd
1 changed files with 2 additions and 1 deletions

View File

@ -9213,7 +9213,8 @@ bool QWidget::event(QEvent *event)
const QWindow *win = te->window;
d->setWinId((win && win->handle()) ? win->handle()->winId() : 0);
}
d->updateFont(d->data.fnt);
if (d->data.fnt.d->dpi != logicalDpiY())
d->updateFont(d->data.fnt);
#ifndef QT_NO_OPENGL
d->renderToTextureReallyDirty = 1;
#endif