@@ -78,12 +78,17 @@ void MacosFrontend::save() {
7878 safeSaveAsIni (config_, ConfPath);
7979}
8080
81- std::string MacosFrontend::keyEvent (ICUUID uuid, const Key &key,
82- bool isRelease ) {
81+ std::string MacosFrontend::keyEvent (ICUUID uuid, const Key &key, bool isRelease,
82+ bool isPassword ) {
8383 auto *ic = this ->findIC (uuid);
8484 if (!ic) {
8585 return " {}" ;
8686 }
87+ CapabilityFlags flags = CapabilityFlag::Preedit;
88+ if (isPassword) {
89+ flags |= CapabilityFlag::Password;
90+ }
91+ ic->setCapabilityFlags (flags);
8792 ic->focusIn ();
8893 KeyEvent keyEvent (ic, key, isRelease);
8994 ic->isSyncEvent = true ;
@@ -271,12 +276,13 @@ MacosInputContext::getCursorCoordinates(bool followCursor) {
271276FCITX_ADDON_FACTORY_V2 (macosfrontend, fcitx::MacosFrontendFactory);
272277
273278std::string process_key (ICUUID uuid, uint32_t unicode, uint32_t osxModifiers,
274- uint16_t osxKeycode, bool isRelease) noexcept {
279+ uint16_t osxKeycode, bool isRelease,
280+ bool isPassword) noexcept {
275281 const fcitx::Key parsedKey =
276282 osx_key_to_fcitx_key (unicode, osxModifiers, osxKeycode);
277283 return with_fcitx ([=](Fcitx &fcitx) {
278284 auto that = dynamic_cast <fcitx::MacosFrontend *>(fcitx.frontend ());
279- return that->keyEvent (uuid, parsedKey, isRelease);
285+ return that->keyEvent (uuid, parsedKey, isRelease, isPassword );
280286 });
281287}
282288
0 commit comments