diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-09-20 22:11:42 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-10-02 19:08:41 +0200 |
commit | fa54471050da82867ccd965977d72b3d6b14f4f5 (patch) | |
tree | 2c5cfd0580eb69c3d7e692121fb42b23b8a698f2 | |
parent | 500be123f4fbb60593fe25d5fe70fbc62445e8aa (diff) |
QCocoaInputContext: Don't emit locale update on startup
We're just resolving the initial locale, via the call site
in the constructor.
Change-Id: I186f4c491c013cce265a855963a8624ce5c6da97
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoainputcontext.mm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.mm b/src/plugins/platforms/cocoa/qcocoainputcontext.mm index b242cd69c6..70461376e2 100644 --- a/src/plugins/platforms/cocoa/qcocoainputcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoainputcontext.mm @@ -150,11 +150,18 @@ void QCocoaInputContext::updateLocale() QString language = QString::fromNSString(languages.firstObject); QLocale locale(language); - if (m_locale != locale) { + + bool localeUpdated = m_locale != locale; + static bool firstUpdate = true; + + m_locale = locale; + + if (localeUpdated && !firstUpdate) { qCDebug(lcQpaInputMethods) << "Reporting new locale" << locale; - m_locale = locale; emitLocaleChanged(); } + + firstUpdate = false; } QT_END_NAMESPACE |