Description
On macOS ImeRequest::Disable is implemented as:
ImeRequest::Disable => {
self.view().set_ime_allowed(None);
return Ok(());
},
However the set_ime_allowed function is defined as:
pub(super) fn set_ime_allowed(&self, capabilities: Option<ImeCapabilities>) {
if self.ivars().ime_capabilities.get().is_some() {
return;
}
self.ivars().ime_capabilities.set(capabilities);
if capabilities.is_some() {
return;
}
// Clear markedText
*self.ivars().marked_text.borrow_mut() = NSMutableAttributedString::new();
if self.ivars().ime_state.get() != ImeState::Disabled {
self.ivars().ime_state.set(ImeState::Disabled);
self.queue_event(WindowEvent::Ime(Ime::Disabled));
}
}
The guard at the very top of this function means that calling this function has no effect if IME is enabled (the macos backend appears to track this by whether the ime_capabilities is Some or None)
macOS version
macOS 15.6.1 (but OS version is unlikely to be relevant)
Winit version
0.31-beta.2
Description
On macOS
ImeRequest::Disableis implemented as:However the
set_ime_allowedfunction is defined as:The guard at the very top of this function means that calling this function has no effect if IME is enabled (the macos backend appears to track this by whether the
ime_capabilitiesisSomeorNone)macOS version
Winit version
0.31-beta.2