macOS: Deliver theme changes synchronously
Otherwise the expose event that AppKit triggers will be delivered before we've propagated the theme change, and we fail to draw the UI using the new theme. Change-Id: I502122a2bf02a866d136106d831f0c2a0dfe26f2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
e2f4c5f4a1
commit
9a77beaea3
@ -880,10 +880,10 @@ void QWindowSystemInterface::handleScreenRefreshRateChange(QScreen *screen, qrea
|
||||
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
|
||||
}
|
||||
|
||||
void QWindowSystemInterface::handleThemeChange(QWindow *window)
|
||||
QT_DEFINE_QPA_EVENT_HANDLER(void, handleThemeChange, QWindow *window)
|
||||
{
|
||||
QWindowSystemInterfacePrivate::ThemeChangeEvent *e = new QWindowSystemInterfacePrivate::ThemeChangeEvent(window);
|
||||
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
|
||||
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(draganddrop)
|
||||
|
@ -249,6 +249,7 @@ public:
|
||||
static void handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal newDpiX, qreal newDpiY);
|
||||
static void handleScreenRefreshRateChange(QScreen *screen, qreal newRefreshRate);
|
||||
|
||||
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
|
||||
static void handleThemeChange(QWindow *window);
|
||||
|
||||
static void handleFileOpenEvent(const QString& fileName);
|
||||
|
@ -129,7 +129,7 @@ void QCocoaTheme::handleSystemThemeChange()
|
||||
QFontCache::instance()->clear();
|
||||
}
|
||||
|
||||
QWindowSystemInterface::handleThemeChange(nullptr);
|
||||
QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>(nullptr);
|
||||
}
|
||||
|
||||
bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const
|
||||
|
Loading…
Reference in New Issue
Block a user