Open Bug 1893868 Opened 1 year ago Updated 1 year ago

Save As... does not remember the last-used IME mode with out-of-process file-dialogs

Categories

(Core :: Widget: Win32, defect, P3)

Firefox 125
defect

Tracking

()

Tracking Status
firefox-esr115 --- unaffected
firefox125 --- wontfix
firefox126 --- wontfix
firefox127 --- wontfix

People

(Reporter: kyokusinn, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: inputmethod, nightly-community, regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

スクリーンショットを撮影
→名前を付けてファイルを保存ダイアログで、日本語入力にしてファイル名を入力。
→再びスクリーンショットを撮影
→名前を付けてファイルを保存ダイアログで、ファイル名を入力しようとすると、ローマ字入力に戻っている。

Actual results:

名前を付けて保存する際の入力方式が、日本語入力からローマ字入力に戻されてしまう。

Expected results:

ファイル名入力時に日本語で入力する設定が保存されてほしかった。

The Bugbug bot thinks this bug should belong to the 'Firefox::Sync' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Sync
Component: Sync → Widget: Win32
Product: Firefox → Core

English translation of comment#0 (using Google Translate)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

take a screenshot
→ In the Save File As dialog box, input the file name using Japanese input.
→Take a screenshot again
→When you try to enter a file name in the Save File As dialog, it reverts to Roman alphabet input.

Actual results:

The input method when saving with a name changes from Japanese input back to Romaji input.

Expected results:

I wish the setting to enter Japanese when entering a file name would be saved.
Summary: 名前を付けてファイルを保存する時の入力方式が毎回ローマ字入力に戻ってしまう → When saving a file with a name, the input method returns to Romaji input every time.

Cannot reproduce on current release, but can reproduce on Firefox Nightly with the file-dialog in a separate process. Chromium and Edge behave identically to Nightly, presumably due to their file-dialog also being in a separate process.

I think this might be possible to implement with the following strategy:

  • Before calling IFileDialog::Show(), set up a window-hook on the file-dialog's window thread to listen for EVENT_OBJECT_CREATE and EVENT_OBJECT_DESTROY events.
    • On _CREATE, acquire the window's IME context, and set it to the last-known IME mode, if any.
    • On _DESTROY, get the IME context's mode, and release the context.

... and of course also set up an IPDL channel to pass the last-known IME mode to and from the main process.

I'm a bit leery of anything involving window-hooks as an implementation strategy, though; they're terribly fragile. (For example, if in some future version of the OS the IME context is changed by Microsoft code after the window is created, this would quietly stop working.) Unfortunately, I don't think Microsoft provides a proper way to get at the file-dialog's IME context...

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Blocks: 1677170
Summary: When saving a file with a name, the input method returns to Romaji input every time. → Save As... does not remember the last-used input method with out-of-process file-dialogs

ご回答いただきありがとうございます。
技術的な事には詳しくありませんので、以下の点について教えて下さい。

・firefox内でIMEを維持する設定やコマンドはありますか?
・Windows10側で制御する方法はありますか?

プログラムの生成はできませんのでご了承下さい。

[Japanese version]

(昔々、大学で日本語を勉強したので、文法や儀礼に間違いがあっても Google Translate だけのせいにはできません。あらかじめお詫び申し上げます。)

ご回答 [...]

申し訳ありません。Comment 3は主に技術に詳しい同僚に向けのでした。

firefox内でIMEを維持する設定やコマンドはありますか?

正直にあるとは言えませんが、今のところは副作用としてそれを実現するものがあります。about:config に移動して widget.windows.utility_process_file_picker-1 に設定すると、IME モードが個々のファイル ダイアログ間で維持されるようです。

ただし、技術的な理由により、これにより Firefox が他のプログラムによって引き起こされるクラッシュに対して脆弱になります。(興味があれば、その技術的な理由を喜んで説明します。) これは一時的な設定だけであり、ある時、効果はなくなる可能性があります。

欲を言うと、comment 3でのような複雑な策略をせずに新実装で IME モードを維持する方法を見つけられるのに...

現状では、かなり困難かもしれません。

Windows10側で制御する方法はありますか?

残念ながら、長年の要求にもかかわらず、Microsoft はそんなことを提供していないようです。


【英ver.】

(Once upon a time, I studied Japanese at university; so if there are any errors of grammar or formality, the blame cannot solely go to Google Translate. I apologize in advance.)

Your response [...]

I'm very sorry. Comment 3 was mostly intended for my technical-minded colleagues.

Is there a setting or command to preserve the IME in Firefox?

I can't honestly say there is, but there's something that will make it happen as a side-effect. If you go to about:config and set widget.windows.utility_process_file_picker to -1, it seems the IME mode will be retained between individual file dialogs.

However, for technical reasons, this makes Firefox more vulnerable to crashes induced by other programs. (I'm happy to explain those technical reasons, if there's interest.) This is merely a temporary setting, and at some point, it's likely to no longer have an effect.

I'd very much like to be able to find a way to preserve the IME mode in the new implementation without the complicated shenanigans in comment 3...

As things stand, this might be quite difficult.

Is there a way to control this from the Windows 10 side?

Unfortunately, despite long having been requested, it seems Microsoft has not provided such a feature.

Summary: Save As... does not remember the last-used input method with out-of-process file-dialogs → Save As... does not remember the last-used IME mode with out-of-process file-dialogs

(とても分かりやすい日本語です。ありがとうございます)

お返事が遅くなり申し訳ありません。

>about:config に移動して widget.windows.utility_process_file_picker を -1 に設定する

試してみましたがIMEモードが保持されません。

バージョン114では維持できていたので、firefox側に修正していただきたいですね。

STR(windows11):

  1. Start Firefox w/ new profile
  2. Click on Address bar to focus
  3. IME ON
  4. Right click on Contents Area And Choose "Save Page As ..."
  5. Observe IME status on the File picker

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ed7eb7f238342d0832d1be824c7d98517e2a388a&tochange=2c589e3ed465c63a3648c35f6ac2005f55a8fe25

Regressed by: Bug 1862712 - pref on out-of-process file-picker

Regressed by: 1862712
No longer regressions: 1862712

Set release status flags based on info from the regressing bug 1862712

And regression window w/ disabled out of process file picker (widget.windows.utility_process_file_picker = -1):

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e8a791b6611aebbe314b430b97b2b70b51e2c239&tochange=3e082a66c7215c2a29aabee626dfaf53d74b3dbe

Regressed by: 1858225

(In reply to 睦月 from comment #6)

>about:config に移動して widget.windows.utility_process_file_picker を -1 に設定する

試してみましたがIMEモードが保持されません。

…しかし、いくら分かりやすくても、情報が間違っていたら…

申し訳ございません。残念ながら、現在のバージョンではそう実現する設定がないと示唆されていることです。

 

(In reply to Alice0775 White from comment #9)

And regression window w/ disabled out of process file picker (widget.windows.utility_process_file_picker = -1):

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e8a791b6611aebbe314b430b97b2b70b51e2c239&tochange=3e082a66c7215c2a29aabee626dfaf53d74b3dbe

... okay, I wasn't expecting that. That means it's thread-local state rather than process-local state... and that suggests that it might actually hang on the HIMC associated with the per-thread default IME window. Hopefully that affords us a mechanism to affect the file-dialog window before we open it, instead of possibly resorting to terrifying hackery.

That still leaves the unhappy necessity of pumping the value back and forth across IPC, but perhaps a pref wouldn't be the wrong place for that...?

(I should note, at some point in this bug, that leaving the IME mode alone is also Chrome's behavior: they have the same out-of-process setup and make no attempt to preserve the IME mode, AFAICT. It would leave a terrible taste in my mouth to use "well, Chrome doesn't do it" as an excuse, though.)

For bookkeeping's sake: this issue affects Fx121+ on Nightly by default, and Fx122+ regardless of release-channel or settings.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: