Replace variant ImeRequest::Disable with fn disable_ime
- [ ] Tested on all platforms changed
- [ ] Added an entry to the
changelogmodule if knowledge of this change could be valuable to users - [ ] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
- [ ] Created or updated an example program if it would help users understand this functionality
This is the first part of #4412. It could be merged as-is or in concert with other changes.
Summary
Replace ImeRequest::Disable with fn disable_ime.
Motivation
It was documented that ImeRequest::Disable cannot fail, yet it returned a Result. This revision removes the API ambiguity.
Would you prefer to merge changes piecemeal (just this commit) or shall I push more IME changes into this PR?
The plan is roughly outlined here.
I think I'll also look myself into it one more time and probably push some of the changes myself.
As you like.
I already made further changes (not pushed yet): move winit::window::Ime* types to new winit_core::ime module, drop Ime prefix for these types.
If you split them into commits, it's fine with me. I can tune based on that.
Pushed.
My further plans are less concrete:
- Split enable / update into separate requests. For the interface I think this makes sense but I'm hesistant because these ops share a lot of code in the backends.
- Replace the error for
update_imewithNotEnabled. Or possibly make it infallible ignoring errors. - Add
ChangeCauseparameter toupdate_ime - Implement
From<ImeRequestData> for ImeEnableRequestto make usage a little easier, while keeping the existing path - Make hint and purpose required in
enable_ime. However, this means thatImeRequestDatacannot be used for bothenable_imeandupdate_ime. - Revise documentation
I think that update and enable should be together, since they are similar and the actual change is semantics, especially given that certain requests only apply on enable in some cases.