Skip to content

gtk+3: im-quartz IM module not loaded (GTK_IM_MODULE_FILE required for Japanese input on macOS) #274830

@shumoku88-bit

Description

@shumoku88-bit

Description

On macOS Sequoia (15.x), the GTK+3 Homebrew package includes im-quartz.so (the macOS native input method bridge), but GTK's module loader fails to find immodules.cache at runtime. As a result, im_module_init() is never called, and Japanese/Chinese/Korean input does not work in GTK3 apps (e.g., gedit).

Workaround

Setting GTK_IM_MODULE_FILE explicitly resolves the module loading issue:

export GTK_IM_MODULE=quartz
export GTK_IM_MODULE_FILE=/usr/local/lib/gtk-3.0/3.0.0/immodules.cache

Diagnosis

  • im-quartz.so is present at /usr/local/Cellar/gtk+3/3.24.52/lib/gtk-3.0/3.0.0/immodules/im-quartz.so
  • immodules.cache exists at /usr/local/lib/gtk-3.0/3.0.0/immodules.cache and correctly references im-quartz.so
  • Without GTK_IM_MODULE_FILE, GtkIMMulticontext falls back to gtk-im-context-simple and im_module_init() is never called (verified via ctypes)
  • With GTK_IM_MODULE_FILE set, the quartz IM context loads and initializes correctly

Expected behavior

GTK should find immodules.cache automatically without requiring GTK_IM_MODULE_FILE to be set.

Environment

  • macOS Sequoia (Darwin 24.6.0)
  • gtk+3 3.24.52 (Homebrew bottle)
  • Quartz backend (-Dquartz_backend=true -Dx11_backend=false)
  • JIS keyboard with Japanese (Kotoeri Romaji) input source enabled

Possible fix

The formula's post-install step or the module cache path search in GTK may need adjustment for the Homebrew Cellar/symlink layout on macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions