Skip to content

Support dark theme in Windows candidate window - #1607

Closed
nameless911 wants to merge 1 commit into
google:masterfrom
nameless911:win32-dark-theme
Closed

nameless911 wants to merge 1 commit into
google:masterfrom
nameless911:win32-dark-theme

Conversation

@nameless911

Copy link
Copy Markdown

Description

#1582 added renderer_style_dark.textproto and RendererStyleHandler::ColorTheme, but only the Qt renderer uses them, so the Win32 candidate window stays light when Windows is in dark mode.

This pull request makes the Win32 renderer follow the Windows app mode:

  • GetScaledRendererStyle() reads AppsUseLightTheme under HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize and picks ColorTheme::kDark when it is 0. All Win32 windows and TextRenderer get their colors through this function, so they switch together.
  • CandidateWindow and InfolistWindow reload the style when Windows broadcasts WM_SETTINGCHANGE with "ImmersiveColorSet", so a mode change takes effect on the next candidate window without restarting.
  • InfolistWindow no longer hard-codes white as the row background; it uses the candidate background color (still white in the light theme).
  • Adds //bazel/win32:advapi32 for RegGetValueW.

The light theme is unchanged. The dark colors are the ones from #1582 as is.

Issue IDs

Steps to test new behaviors (if any)

  • OS: Windows 11 (x64)
  • Steps:
    1. Set "Choose your app mode" to Dark in Settings > Personalization > Colors.
    2. Type with Mozc to show the suggestion, prediction and conversion windows.
    3. Confirm that they are drawn with the dark style, and that they return to the light style after switching the app mode back to Light.

Done so far:

  • The unmodified CI for Windows workflow passes on my fork (x64, universal and arm64 builds, and the x64/arm64 tests).
  • Installed the resulting Mozc64_x64.msi and confirmed step 3 for the suggestion and prediction windows in dark mode.
  • Not checked yet: the conversion window, the infolist window, switching the mode while the renderer is running, and the light theme after this change.

Additional context

Not covered in this pull request:

  • IndicatorWindow (mode indicator) still uses hard-coded colors.
  • The footer logo bitmap is not adjusted for dark backgrounds.

Happy to follow up on these, or to change the approach if there is a different plan for Windows dark theme support.

Follow the Windows app mode (AppsUseLightTheme) and use the dark renderer
style added for the Qt renderer (google#1582). Reload the style when Windows
broadcasts WM_SETTINGCHANGE with "ImmersiveColorSet", and stop hard-coding
white as the infolist row background.
@yukawa

yukawa commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the PR and for offering to adapt the approach.

I intentionally excluded Windows and macOS from PR #1582. The dark theme support is still experimental, and changes to the Windows and macOS builds also impact Google Japanese Input.

Before turning this on by default for Windows and macOS, I plan to:

  1. Introduce a default-off build flag so that I can continue working without exposing half-baked UI changes and always keep Google's internal repository release-ready.
  2. Complete the dark theme support. This includes discussions around handling the footer logo, which is unavoidable for the Google Japanese Input build.
  3. Introduce a preference setting allowing users to choose Always Light, Always Dark, or Follow System. Otherwise, the product forum will inevitably receive such feature requests.
  4. Let the team within Google decide when to enable the feature by default.

While I appreciate your willingness to follow up on a different approach, I think handling these changes among the core committers will actually be easier and more efficient for this particular feature. The most costly part here is the communication and coordination rather than the code implementation itself, which is straightforward and easy to automate these days once the direction is agreed on.

Therefore, I'll be closing this PR. That said, I love to see people fork and customize our codebase to demonstrate their ideas. Feel free to use the Discussions forum, e.g. "Show and tell" category, to share your ideas with us and other developers.

Thanks again for your understanding and your interest in Mozc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants