From 9daa0738a9aeb60768d9b7d19f4e3deddd55958b Mon Sep 17 00:00:00 2001
From: hatoo <hato2000@gmail.com>
Date: Wed, 15 Jan 2020 06:52:18 +0900
Subject: [PATCH] on MacOS, Fix not sending ReceivedCharacter event for some
 key combination (#1347)

* MacOS FIX #1267

* Add CHANGELOG

* Remove unnecessary trace!
---
 CHANGELOG.md                    | 2 ++
 src/platform_impl/macos/view.rs | 9 ++-------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a971693f..b048eb39 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # Unreleased
 
+- On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
 - On macOS, fix `CursorMoved` event reporting the cursor position using logical coordinates.
 - On macOS, fix issue where unbundled applications would sometimes open without being focused.
 - On macOS, fix `run_return` does not return unless it receives a message.
@@ -12,6 +13,7 @@
 # 0.20.0 (2020-01-05)
 
 - On X11, fix `ModifiersChanged` emitting incorrect modifier change events
+
 - **Breaking**: Overhaul how Winit handles DPI:
   + Window functions and events now return `PhysicalSize` instead of `LogicalSize`.
   + Functions that take `Size` or `Position` types can now take either `Logical` or `Physical` types.
diff --git a/src/platform_impl/macos/view.rs b/src/platform_impl/macos/view.rs
index c0b2adc5..741ecb48 100644
--- a/src/platform_impl/macos/view.rs
+++ b/src/platform_impl/macos/view.rs
@@ -383,13 +383,8 @@ extern "C" fn reset_cursor_rects(this: &Object, _sel: Sel) {
     }
 }
 
-extern "C" fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
-    unsafe {
-        trace!("Triggered `hasMarkedText`");
-        let marked_text: id = *this.get_ivar("markedText");
-        trace!("Completed `hasMarkedText`");
-        (marked_text.length() > 0) as i8
-    }
+extern "C" fn has_marked_text(_this: &Object, _sel: Sel) -> BOOL {
+    YES
 }
 
 extern "C" fn marked_range(this: &Object, _sel: Sel) -> NSRange {