diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 1074e422f..e07197e1c 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -2479,6 +2479,13 @@ void _glfwPlatformSetClipboardString(const char* string) [pasteboard setString:@(string) forType:NSPasteboardTypeString]; } +void _glfwPlatformSetPrimarySelectionString(const char* string) { + (void)string; + // Apple doesnt have a primary selection +} + +const char* _glfwPlatformGetPrimarySelectionString(void) { return ""; } + const char* _glfwPlatformGetClipboardString(void) { NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; diff --git a/glfw/input.c b/glfw/input.c index eff7250da..ea2c48073 100644 --- a/glfw/input.c +++ b/glfw/input.c @@ -1540,7 +1540,7 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle UNUSED) return _glfwPlatformGetClipboardString(); } -#if defined(_GLFW_X11) || defined(_GLFW_WAYLAND) +#if defined(_GLFW_X11) || defined(_GLFW_WAYLAND) || defined(__APPLE__) GLFWAPI void glfwSetPrimarySelectionString(GLFWwindow* handle UNUSED, const char* string) { assert(string != NULL); diff --git a/glfw/internal.h b/glfw/internal.h index f420b4068..a36403457 100644 --- a/glfw/internal.h +++ b/glfw/internal.h @@ -675,7 +675,7 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) void _glfwPlatformSetClipboardString(const char* string); const char* _glfwPlatformGetClipboardString(void); -#if defined(_GLFW_X11) || defined(_GLFW_WAYLAND) +#if defined(_GLFW_X11) || defined(_GLFW_WAYLAND) || defined(__APPLE__) void _glfwPlatformSetPrimarySelectionString(const char* string); const char* _glfwPlatformGetPrimarySelectionString(void); #endif