Module: wine Branch: master Commit: d77006fd5a68a3aaefdeeb9985e4b39b67e58b2b URL: https://gitlab.winehq.org/wine/wine/-/commit/d77006fd5a68a3aaefdeeb9985e4b39...
Author: Tim Clem tclem@codeweavers.com Date: Wed May 15 13:09:51 2024 -0700
winemac.drv: Exclude dictation when looking for input methods.
After a recent OS update, the dictation input source remains "selected" in *all* apps for about 10 minutes after it is activated, even when it is not in use. There doesn't seem to be any way to determine whether it's actually active or just lingering, and sending input to it regardless means that we falsely process input as if it was going to an IME.
---
dlls/winemac.drv/cocoa_app.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index f6a9cd145ea..61ab38cdc82 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -2065,9 +2065,7 @@ static NSString* WineLocalizedString(unsigned int stringID) static BOOL InputSourceShouldBeIgnored(TISInputSourceRef inputSource) { /* Certain system utilities are technically input sources, but we - shouldn't consider them as such for our purposes. - Dictation is its own source too (com.apple.inputmethod.ironwood), but - it should receive keypresses; it cancels input on escape. */ + shouldn't consider them as such for our purposes. */ static CFStringRef ignoredIDs[] = { /* The "Emoji & Symbols" palette. */ CFSTR("com.apple.CharacterPaletteIM"), @@ -2077,6 +2075,11 @@ static NSString* WineLocalizedString(unsigned int stringID) CFSTR("com.apple.PressAndHold"), /* Emoji list on MacBooks with the Touch Bar. */ CFSTR("com.apple.inputmethod.EmojiFunctionRowItem"), + /* Dictation. Ideally this would actually receive key events, since + escape cancels it, but it remains a "selected" input source even + when not active, so we need to ignore it to avoid incorrectly + sending input to it. */ + CFSTR("com.apple.inputmethod.ironwood"), };
CFStringRef sourceID = TISGetInputSourceProperty(inputSource, kTISPropertyInputSourceID);