-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[0.31-beta.2] Disabling IME is broken on macOS #4432
Copy link
Copy link
Closed
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backend
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backend