Skip to content

Feat/support multiple input methods rebased#4

Merged
rano-oss merged 9 commits into
feat/support_multiple_input_methodsfrom
feat/support_multiple_input_methods-rebased
Jan 5, 2026
Merged

Feat/support multiple input methods rebased#4
rano-oss merged 9 commits into
feat/support_multiple_input_methodsfrom
feat/support_multiple_input_methods-rebased

Conversation

@rano-oss
Copy link
Copy Markdown
Owner

@rano-oss rano-oss commented Jan 5, 2026

No description provided.

- Add app_id field to input method instances, extracted from PID
- Change API to use app_id strings instead of ObjectId/Handle
- Restore input_method_handle to TextInputUserData (shared)
- Store Optional<ObjectId> in text input instances for per-client assignment
- Update set_active_instance() to take app_id parameter
- Update set_input_method() to work on focused text input only
- Update set_input_method_globally() to use app_id

This provides a cleaner API where:
- app_id is the stable identifier (e.g. 'fcitx5', 'ibus-daemon')
- Compositors don't need to track ObjectIds
- Only focused text input can be changed (unless global mode)
The InputMethodHandle is now stored inside TextInputHandle, removing
the need to pass it as a parameter to set_input_method() methods.

Before:
  text_input_handle.set_input_method("fcitx5", &input_method_handle);

After:
  text_input_handle.set_input_method("fcitx5");

This is cleaner since both handles come from the same seat's user data.
Reverts embedding InputMethodHandle in TextInputHandle. The handle
is now passed as a parameter again for more flexibility.

API:
- InputMethodHandle::set_active_instance(app_id) - no parameter
- TextInputHandle::set_input_method(app_id, &handle) - takes handle
- TextInputHandle::set_input_method_globally(app_id, &handle) - takes handle
When a new text input instance is created, it now defaults to using
the currently active input method (if any). This ensures new text
inputs automatically use the global active input method in global mode.
@rano-oss rano-oss merged commit a8afb20 into feat/support_multiple_input_methods Jan 5, 2026
@rano-oss rano-oss deleted the feat/support_multiple_input_methods-rebased branch January 13, 2026 11:32
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.

1 participant