Skip to content

Conversation

@rano-oss
Copy link
Contributor

@rano-oss rano-oss commented Nov 3, 2025

No description provided.

@rano-oss rano-oss marked this pull request as draft November 3, 2025 22:27
@ids1024
Copy link
Member

ids1024 commented Nov 3, 2025

How is having multiple input method engines supposed to work? Only one input method can be handling input for a single seat/keyboard at a given moment, surely?

@rano-oss
Copy link
Contributor Author

rano-oss commented Nov 4, 2025

I am working on a POC, and yes only one input method can handle input for a single seat/keyboard at a given moment. That is why there is an active input method field, anyway the thing is support for keyboard switching with global or per client would have to be added to the compositor so why not just get them all in one fell swoop. I will cook and post a video if I can make it work ;)

- 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.
…ds-rebased

Feat/support multiple input methods rebased
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.

2 participants