Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inline input method support #5790

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Support for OpenGL ES 2.0
- Escape sequence to set underline color (`CSI 58 : 2 : Ps : Ps : Ps m`/`CSI 58 : 5 : Ps m`)
- Escape sequence to reset underline color (`CSI 59 m`)
- Support for inline input method
Copy link

@pickfire pickfire Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to mention that the caveat is that on x11 only off-the-spot preedit area (no over-the-spot or on-the-spot) is supported due to library limitations (xcb not available)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure. It's kind of common and I've seen other clients with such issue.

@chrisduerr what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have absolutely no clue what these different IME modes are, but chances are if we just say "support XYZ" and Toby's version of XYZ doesn't work he'll come crying on the issue tracker. So we should set the expectations so people are aware of which setups should and shouldn't work now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like IME is now stuck at the bottom of the window due to libX11 limitations in CHANGED?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IME is only available at the bottom of the window (off-the-spot preedit area) due to libX11 limitations for x11

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I kind of like the one I have in CHANGELOG right now, since it's more about changed.

Copy link

@pickfire pickfire Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also about changed, but at least it needs to mention the unexpected, better than letting users dig in to figure out why it didn't work as they expected.


### Changed

- The `--help` output was reworked with a new colorful syntax
- OSC 52 is now disabled on unfocused windows
- Search bar is now respecting cursor thickness
- On X11 the IME popup window is stuck at the bottom of the window due to libX11 limitations
- IME no longer works in Vi mode when moving around

### Fixed

Expand Down
177 changes: 156 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ members = [
lto = true
debug = 1
incremental = false

[patch.crates-io]
winit = { git = "https://github.com/rust-windowing/winit", branch = "composition-event" }
2 changes: 1 addition & 1 deletion alacritty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ wayland-client = { version = "0.29.0", features = ["dlopen"], optional = true }
winapi = { version = "0.3.7", features = ["impl-default", "wincon"]}

[target.'cfg(windows)'.build-dependencies]
embed-resource = "1.3"
embed-resource = "1.7.1"

[features]
default = ["wayland", "x11"]
Expand Down
2 changes: 1 addition & 1 deletion alacritty/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
.unwrap();

#[cfg(windows)]
embed_resource::compile("./windows/windows.rc");
embed_resource::compile("./windows/alacritty-icon.rc");
}

fn commit_hash() -> Option<String> {
Expand Down
5 changes: 5 additions & 0 deletions alacritty/src/display/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl<'a> RenderableContent<'a> {
// Find terminal cursor shape.
let cursor_shape = if terminal_content.cursor.shape == CursorShape::Hidden
|| display.cursor_hidden
|| display.handling_ime()
|| search_state.regex().is_some()
{
CursorShape::Hidden
Expand Down Expand Up @@ -386,6 +387,10 @@ impl RenderableCursor {
}

impl RenderableCursor {
pub fn new(point: Point<usize>, shape: CursorShape, cursor_color: Rgb, is_wide: bool) -> Self {
Self { point, shape, cursor_color, text_color: cursor_color, is_wide }
}

pub fn color(&self) -> Rgb {
self.cursor_color
}
Expand Down