Skip to content

Commit b208daa

Browse files
kchibisovOsspial
andauthored
Revert "on MacOS, Fix not sending ReceivedCharacter event for s… (#1501)
This reverts commit 9daa073. This commit introduced other bug #1453 with likely much more common bindings, so reverting it for now. Fixes #1453. Co-authored-by: Osspial <osspial@gmail.com>
1 parent e85a80d commit b208daa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
- On Windows, add `IconExtWindows` trait which exposes creating an `Icon` from an external file or embedded resource
1616
- Add `BadIcon::OsError` variant for when OS icon functionality fails
1717
- On Windows, fix crash at startup on systems that do not properly support Windows' Dark Mode
18+
- Revert On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
19+
- on macOS, fix incorrect ReceivedCharacter events for some key combinations.
1820
- **Breaking:** Use `i32` instead of `u32` for position type in `WindowEvent::Moved`.
1921

2022
# 0.21.0 (2020-02-04)
@@ -37,7 +39,6 @@
3739
# 0.20.0 (2020-01-05)
3840

3941
- On X11, fix `ModifiersChanged` emitting incorrect modifier change events
40-
4142
- **Breaking**: Overhaul how Winit handles DPI:
4243
+ Window functions and events now return `PhysicalSize` instead of `LogicalSize`.
4344
+ Functions that take `Size` or `Position` types can now take either `Logical` or `Physical` types.

src/platform_impl/macos/view.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,13 @@ extern "C" fn reset_cursor_rects(this: &Object, _sel: Sel) {
383383
}
384384
}
385385

386-
extern "C" fn has_marked_text(_this: &Object, _sel: Sel) -> BOOL {
387-
YES
386+
extern "C" fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
387+
unsafe {
388+
trace!("Triggered `hasMarkedText`");
389+
let marked_text: id = *this.get_ivar("markedText");
390+
trace!("Completed `hasMarkedText`");
391+
(marked_text.length() > 0) as i8
392+
}
388393
}
389394

390395
extern "C" fn marked_range(this: &Object, _sel: Sel) -> NSRange {

0 commit comments

Comments
 (0)