aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ime.c15
-rw-r--r--ime.h3
-rw-r--r--render.c4
3 files changed, 12 insertions, 10 deletions
diff --git a/ime.c b/ime.c
index 6c65265d..a224d570 100644
--- a/ime.c
+++ b/ime.c
@@ -344,8 +344,8 @@ ime_reset_preedit(struct seat *seat)
seat->ime.preedit.count = 0;
}
-void
-ime_send_cursor_rect(struct seat *seat, struct terminal *term)
+static void
+ime_send_cursor_rect(struct seat *seat)
{
if (unlikely(seat->wayl->text_input_manager == NULL))
return;
@@ -353,6 +353,8 @@ ime_send_cursor_rect(struct seat *seat, struct terminal *term)
if (!seat->ime.focused)
return;
+ struct terminal *term = seat->kbd_focus;
+
if (!term->ime_enabled)
return;
@@ -437,8 +439,10 @@ ime_disable(struct seat *seat)
}
void
-ime_update_cursor_rect(struct seat *seat, struct terminal *term)
+ime_update_cursor_rect(struct seat *seat)
{
+ struct terminal *term = seat->kbd_focus;
+
/* Set in render_ime_preedit() */
if (seat->ime.preedit.cells != NULL)
goto update;
@@ -469,7 +473,7 @@ ime_update_cursor_rect(struct seat *seat, struct terminal *term)
seat->ime.cursor_rect.pending.height = height;
update:
- ime_send_cursor_rect(seat, term);
+ ime_send_cursor_rect(seat);
}
const struct zwp_text_input_v3_listener text_input_listener = {
@@ -485,12 +489,11 @@ const struct zwp_text_input_v3_listener text_input_listener = {
void ime_enable(struct seat *seat) {}
void ime_disable(struct seat *seat) {}
-void ime_update_cursor_rect(struct seat *seat, struct terminal *term) {}
+void ime_update_cursor_rect(struct seat *seat) {}
void ime_reset_pending_preedit(struct seat *seat) {}
void ime_reset_pending_commit(struct seat *seat) {}
void ime_reset_pending(struct seat *seat) {}
void ime_reset_preedit(struct seat *seat) {}
-void ime_send_cursor_rect(struct seat *seat, struct terminal *term) {}
#endif
diff --git a/ime.h b/ime.h
index 01438a5a..2aa4efe4 100644
--- a/ime.h
+++ b/ime.h
@@ -13,10 +13,9 @@ struct terminal;
void ime_enable(struct seat *seat);
void ime_disable(struct seat *seat);
-void ime_update_cursor_rect(struct seat *seat, struct terminal *term);
+void ime_update_cursor_rect(struct seat *seat);
void ime_reset_pending_preedit(struct seat *seat);
void ime_reset_pending_commit(struct seat *seat);
void ime_reset_pending(struct seat *seat);
void ime_reset_preedit(struct seat *seat);
-void ime_send_cursor_rect(struct seat *seat, struct terminal *term);
diff --git a/render.c b/render.c
index 79f90cc7..dd8070e0 100644
--- a/render.c
+++ b/render.c
@@ -2739,7 +2739,7 @@ frame_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_da
tll_foreach(term->wl->seats, it) {
if (it->item.kbd_focus == term)
- ime_update_cursor_rect(&it->item, term);
+ ime_update_cursor_rect(&it->item);
}
term->grid = original_grid;
@@ -3195,7 +3195,7 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
tll_foreach(term->wl->seats, it) {
if (it->item.kbd_focus == term)
- ime_update_cursor_rect(&it->item, term);
+ ime_update_cursor_rect(&it->item);
}
term->grid = original_grid;