mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
OSX: Disabled default native Mac clipboard copy/paste implementation in core library (added in 1.71), because it needs application to be linked with '-framework ApplicationServices'. It can be explicitly enabled back by using '#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS' in imconfig.h. Re-added equivalent using NSPasteboard api in the imgui_impl_osx.mm experimental back-end. (#2546)
This commit is contained in:
@ -9504,12 +9504,13 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
|
||||
::CloseClipboard();
|
||||
}
|
||||
|
||||
#elif defined(__APPLE__) && TARGET_OS_OSX && !defined(IMGUI_DISABLE_OSX_FUNCTIONS)
|
||||
#elif defined(__APPLE__) && TARGET_OS_OSX && defined(IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS)
|
||||
|
||||
#include <Carbon/Carbon.h> // Use old API to avoid need for separate .mm file
|
||||
static PasteboardRef main_clipboard = 0;
|
||||
|
||||
// OSX clipboard implementation
|
||||
// If you enable this you will need to add '-framework ApplicationServices' to your linker command-line!
|
||||
static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
|
||||
{
|
||||
if (!main_clipboard)
|
||||
|
Reference in New Issue
Block a user