diff options
| author | Manolo Gouy <Manolo> | 2014-11-07 17:08:13 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2014-11-07 17:08:13 +0000 |
| commit | 13cd0a16b544539cb5ae120e4e5477b4db3a3e9e (patch) | |
| tree | f741d421d2ba238c03b7d406b20efdd471df0218 /src | |
| parent | f2bb3ea76cae066113683641043d835c53658301 (diff) | |
Replace deprecated pasteboard manager by cocoa NSPasteboard.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10438 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 21 |
1 files changed, 4 insertions, 17 deletions
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); } |
