Closed Bug 1614252 Opened 6 years ago Closed 6 years ago

Mouse down events are consumed once Firefox is inactivated during composition of All Korean IME of Apple on Catalina

Categories

(Core :: Widget: Cocoa, defect, P1)

73 Branch
Other
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox-esr68 --- wontfix
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- verified
firefox76 --- verified

People

(Reporter: korsnack, Assigned: masayuki)

Details

(Keywords: inputmethod)

Attachments

(1 external file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0

Steps to reproduce:

  1. Korean is selected as current input source
  2. Spend some time
  3. Activate browser window (Cmd+Tab)

Actual results:

"Sometimes" whole browser window does not accept any click input.
Once after changing input source to English, everything gets back into normal.

Expected results:

Browser should accept click input.

It is hard to reproduce since it does not "always" happen, but this keeps happening on my PC few times a day, and apparently my friends are having same issue.

Hello,
I checked if this issue occurs on Nightly version 75.0a1 (2020-02-13), beta version 74.0b3 and the current release 73.0 using the steps provided but was unable to reproduce it.

Can you please re-test the issue while in Safe Mode. You can find helpful info here : https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode .

Also a fresh new profile could help. You can find more about creating a new profile here : https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems#w_6-create-a-new-firefox-profile .

If possible, you can test this issue on the nightly build as well. Download the build from : https://www.mozilla.org/en-US/firefox/nightly/all/ .

Flags: needinfo?(korsnack)

I'm going to try to reproduce with freshly installed Nightly build (75.0a1 at the moment), no profile and in safe mode.

Finally I've found a reliable way to reproduce this behavior.

Video: https://www.youtube.com/watch?v=A3fjhpFgmbY

  1. Change input source to Korean (2-set)
  2. Focus an input (address bar, <input> in document, ...), start type something, and don't finish a character (which is an important part)
    • notice on the video above, I've typed 한글 into address bar, but autocomplete thingy only shows 한, since 글 character has not completed
  3. Switch to different window, then back to Firefox
  4. Nothing can't be clicked (document still can receive hover/mouseover events)

This does not happen in other apps, or with Japanese input. I'm not sure same issue exists with 3-set inputs, or previous versions of macOS.

If character is finished by switching to different input source or pressing arrow key, this issue does not happen.

Flags: needinfo?(korsnack)

Update: In step 2, you don't have to type into Firefox. Just type into any application. VS Code, iTerm, or even Spotlight search. Type Korean, don't finish last character, then Firefox stops accepting click input.

(In reply to Jaemin Noh from comment #5)

Update: In step 2, you don't have to type into Firefox. Just type into any application. VS Code, iTerm, or even Spotlight search. Type Korean, don't finish last character, then Firefox stops accepting click input.

Sorry. Ignore this. I've made a mistake. Looks like Firefox was already in an unclickable state.

I was able to reproduce this on the latest Nightly version 75.0a1 (2020-03-06) .

I was unable to find a regression since the issue is intermitent and also reproducible on FF 65.0a1 from 02 December 2018.

Status: UNCONFIRMED → NEW
Component: Untriaged → Widget: Cocoa
Ever confirmed: true
OS: Unspecified → macOS
Product: Firefox → Core
Hardware: Unspecified → Other

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

I'm not sure this information helps, but I've observed same behavior with a JetBrains product(PyCharm, to be specific). I couldn't find any other software have same issue.

I think Firefox doing something different at some point on input handling with others.

n-i Masayuki in case he has an idea of what might be happening here.

Flags: needinfo?(masayuki)
Priority: -- → P3

I can reproduce this bug only on Catalina (10.15). And I took a log, but I don't see any odd log in it.

Perhaps, we hit a bug of 2-set IME on Catalina. According to (document of IMK](https://developer.apple.com/documentation/inputmethodkit/imkmousehandling?language=objc), IME can steal mouse events. I guess 2-set IME unexpectedly consumes our mouse events at this situation. I'll look for some hack for avoiding the situation.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
Keywords: inputmethod
Priority: P3 → P1
Summary: Clicking does not work with Korean keyboard in macOS → Mouse button events are not available once Firefox is inactivated during composition of 2-set Korean IME on Catalina
Severity: normal → critical

According to the symptom, 2-set Korean IME keeps handling (and consuming) mouse events even after its composition is discarded. I'm still not sure the reason, but once you set an <input> element or something which is editable, you can restart to use mouse buttons again. So, this behavior must be a big hint how to fix this bug.

Masayuki, do you have any update on this bug?

Flags: needinfo?(masayuki)

I still don't find the reason and a way to avoid it. Oddly, even if I commented out the API calls during focus change, I reproduce it.

Flags: needinfo?(masayuki)

Okay, I got the reason why mousedown events are consumed by the Korean IME. We're the only browser which allows IME to handle mouse button events.
https://searchfox.org/mozilla-central/rev/d6f957415cf009995ecb539ef1425316d82164a9/widget/cocoa/TextInputHandler.mm#4668,4672-4673

So, oddly, when it happens, Korean IME starts to consume all coming native mousedown events accidentally. I'll keep investigating how we can avoid this.

I can reproduce this bug with any Korean IME of Apple, but I cannot reproduce this with other languages' IMEs. Therefore, I reported this to Apple.

The bugs is reproducible only with all Korean IMEs of Apple only on Catalina.
Until Apple fixes the bug, we should not allow the Korean IMEs to consume
mouse events. (I think that we should keep notifying all mouse events for
backward compatibility.)

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/a90cee83193c Don't allow Korean IMEs of Apple to consume mouse events when there is no composition r=m_kato
Summary: Mouse button events are not available once Firefox is inactivated during composition of 2-set Korean IME on Catalina → Mouse down events are consumed once Firefox is inactivated during composition of All Korean IME of Apple on Catalina
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76

Comment on attachment 9134067 [details]
Bug 1614252 - Don't allow Korean IMEs of Apple to consume mouse events when there is no composition

Beta/Release Uplift Approval Request

  • User impact if declined: Most Korean language users uses Korean IME for typing Hangul characters. The behavior is similar to dead key in Western languages'. Therefore, user may switch window while they type Hangul characters or another application may steal focus during typing Korean characters. When users meet the situation, all mouse button down events are consumed by Korean IME even if there is no composing Hangul character. So, when user meets this bug, user could consider stop using Firefox.

I checked the fix in my local build and try build for Beta.

  1. Type Hangul characters with a Korean IME on Catalina (all Korean IME on Catalina have this bug)
  2. When you see underlined Hangul character, click desktop or another app's window
  3. Switch back to Firefox's window with clicking title bar or Cmd + Tab.
  4. Click any elements like tabs, searchbar, URL bar.

Then, focus should be set to the clicked element normally.

  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This only stops consuming mouse events when:
  • On Catalina (10.15)
  • There is no composing string
  • Active IME is a Korean IME of Apple

Even if there were regressions, IME couldn't consume handled mouse events. But it must be rare case. Usually, mouse events may be handled by IMEs for:

  • Committing composing string
  • Selecting target to convert clause at typing Japanese text
    However, these features are optional, and currently, the latter isn't supported on major Japanese IMEs on macOS (I confirmed with Apple's Kotoeri, ATOK and Google Japanese Input).
  • String changes made/needed:
Attachment #9134067 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Hello I have managed to reproduce the issue on Fx 75.0a1 (2020-03-06) using MacOS 10.15.4, I can confirm that the issue is fixed on Fx 76.0a1 (2020-03-20).

Sounds like a longstanding issue, IME tends to be fragile and not covered by automated tests, I think this should ride the trains.

Attachment #9134067 - Flags: approval-mozilla-beta? → approval-mozilla-beta-

(In reply to Julien Cristau [:jcristau] from comment #22)

Sounds like a longstanding issue, IME tends to be fragile and not covered by automated tests, I think this should ride the trains.

No, it's not a long standing bug because we hit a bug of Catalina's Korean IME bug. And the symptom is really critical.

Flags: needinfo?(jcristau)

Catalina shipped in October, though, why are we only finding out about this now?

Flags: needinfo?(jcristau) → needinfo?(masayuki)

(In reply to Julien Cristau [:jcristau] from comment #24)

Catalina shipped in October, though, why are we only finding out about this now?

I think that it depends on the rate of Korean language users of us and the rate of reporting bug users of them. (I don't know the rate of the former, and of course the latter too.)

Flags: needinfo?(masayuki) → needinfo?(jcristau)

(And I don't know how much users start to use new macOS immediately after the release...)

Not many people use macOS AND Firefox in Korea(maybe less than a percent?), so that could be one reason.

Judging from my tweet from January, I've been suffering this issue for a long time. Since I update my Mac as soon as a new version is released, it could've been bothering me for half a year. I just didn't know how to reproduce it for a long time.

Comment on attachment 9134067 [details]
Bug 1614252 - Don't allow Korean IMEs of Apple to consume mouse events when there is no composition

targeted workaround for a Korean IME issue on macos 10.15, for 75.0b10

Flags: needinfo?(jcristau)
Attachment #9134067 - Flags: approval-mozilla-beta- → approval-mozilla-beta+

Hello I managed to reproduce the issue on Fx 75.0b9 using MacOs 10.15.4 and I can confirm that the issue is fixed in the build provided in comment 29 (75.0b10).

Ryan, do you consider this needs to be uplifted in esr?

Flags: needinfo?(ryanvm)

I'd prefer to let this bake before we make that decision.

Flags: needinfo?(ryanvm)

Hello Masayuki, is this something you feel we should take on ESR as well? I haven't heard of any regressions caused by this, but I also haven't heard of any complaints about this not being fixed there either.

Flags: needinfo?(masayuki)

Well, ESR will be used until 22-September at most. But we'll ship new ESR in end of June... I guess that in the normal situation, we don't need to fix it in ESR 68, however, many companies/organizations using ESR may not have much time to switch ESR to 78 in this summar because of COVID-19 situation. Do we have some (new) consideration for uplifting patches to ESR in this situation? (E.g., considering longer support of ESR 68?)

Flags: needinfo?(masayuki) → needinfo?(ryanvm)

We're not planning to lengthen the support timeframe for ESR68.

Flags: needinfo?(ryanvm)

Okay, then, I think that we should uplift it to ESR68 only when some users request it actually. (I feel it does not make sense to use ESR68, but use the latest macOS if users need stable environment...)

Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: