From e9823eb40c3e1a45b6a457d0d05fced73a52dc8c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Aug 2022 08:54:47 +0530 Subject: [PATCH] Cleanup previous PR --- docs/changelog.rst | 2 ++ glfw/cocoa_window.m | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a52fb01a9..5a7e515a8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -97,6 +97,8 @@ Detailed list of changes - ssh kitten: Allow completion of ssh options between the destination and command (:iss:`5322`) +- macOS: Fix speaking selected text not working (:iss:`5357`) + 0.25.2 [2022-06-07] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index d3d2f1a53..94a06d1b8 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1558,16 +1558,15 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) { - (NSString *)accessibilitySelectedText { + NSString *text = nil; if (_glfw.callbacks.get_current_selection) { - NSString *text = nil; const char *s = _glfw.callbacks.get_current_selection(); if (s) { text = [NSString stringWithUTF8String:s]; - free((void*) s); - return text; + free(s); } } - return nil; + return text; } @end