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