From 13cd0a16b544539cb5ae120e4e5477b4db3a3e9e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 7 Nov 2014 17:08:13 +0000 Subject: Replace deprecated pasteboard manager by cocoa NSPasteboard. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10438 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index abb568cde..90b133b27 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3057,14 +3057,6 @@ char *fl_selection_buffer[2] = {NULL, NULL}; int fl_selection_length[2] = {0, 0}; static int fl_selection_buffer_length[2]; -static PasteboardRef allocatePasteboard(void) -{ - PasteboardRef clip; - PasteboardCreate(kPasteboardClipboard, &clip); // requires Mac OS 10.3 - return clip; -} -static PasteboardRef myPasteboard = allocatePasteboard(); - extern void fl_trigger_clipboard_notify(int source); void fl_clipboard_notify_change() { @@ -3073,15 +3065,10 @@ void fl_clipboard_notify_change() { static void clipboard_check(void) { - PasteboardSyncFlags flags; - - flags = PasteboardSynchronize(myPasteboard); // requires Mac OS 10.3 - - if (!(flags & kPasteboardModified)) - return; - if (flags & kPasteboardClientIsOwner) - return; - + static NSInteger oldcount = -1; + NSInteger newcount = [[NSPasteboard generalPasteboard] changeCount]; + if (newcount == oldcount) return; + oldcount = newcount; fl_trigger_clipboard_notify(1); } -- cgit v1.2.3