Skip to content

Commit

Permalink
Add MOZC_IBUS_CANDIDATE_WINDOW environment variable.
Browse files Browse the repository at this point in the history
If this variable is set to `ibus`, the default Ibus candidate window is used.
If this variable is set to `mozc`, the Mozc candidate window is used.

* #637

PiperOrigin-RevId: 495258411
  • Loading branch information
hiroyuki-komatsu committed Dec 14, 2022
1 parent 8dcc2bb commit 4a77c6a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,16 @@ engines {
composition_mode: DIRECT
}
```


### Use the default Ibus candidate window

If the environment variable `MOZC_IBUS_CANDIDATE_WINDOW` is set to `ibus`,
The default Ibus candidate window is used instead of the Mozc candidate window.

If `MOZC_IBUS_CANDIDATE_WINDOW` is set to `mozc`, the Mozc candidate window is
always used.

Note, the default Ibus candidate window may not have the full features
we provide to the Mozc candidate window such as information list
(e.g. word usage dictionary).
9 changes: 9 additions & 0 deletions src/unix/ibus/mozc_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ bool UseMozcCandidateWindow() {
return false;
}

// Follows the user's preference set in the environment variable.
const std::string candidate_window = GetEnv("MOZC_IBUS_CANDIDATE_WINDOW");
if (candidate_window == "ibus") {
return false;
}
if (candidate_window == "mozc") {
return true;
}

#ifndef ENABLE_QT_RENDERER
if (GetEnv("XDG_SESSION_TYPE") == "wayland") {
// mozc_renderer is not supported on wayland session.
Expand Down

0 comments on commit 4a77c6a

Please sign in to comment.