You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fltk-1_v2.3.x-clipboard-osx.patch 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
  2. --- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-18 19:24:30.971688769 +0200
  3. +++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-18 19:25:25.700310375 +0200
  4. @@ -1319,9 +1319,13 @@
  5. }
  6. @end
  7. +static void clipboard_check(void);
  8. +
  9. @implementation FLApplication
  10. + (void)sendEvent:(NSEvent *)theEvent
  11. {
  12. + // update clipboard status
  13. + clipboard_check();
  14. NSEventType type = [theEvent type];
  15. if (type == NSLeftMouseDown) {
  16. fl_lock_function();
  17. @@ -2790,6 +2794,26 @@
  18. PasteboardCreate(kPasteboardClipboard, &myPasteboard);
  19. }
  20. +extern void fl_trigger_clipboard_notify(int source);
  21. +
  22. +void fl_clipboard_notify_change() {
  23. + // No need to do anything here...
  24. +}
  25. +
  26. +static void clipboard_check(void)
  27. +{
  28. + PasteboardSyncFlags flags;
  29. +
  30. + allocatePasteboard();
  31. + flags = PasteboardSynchronize(myPasteboard);
  32. +
  33. + if (!(flags & kPasteboardModified))
  34. + return;
  35. + if (flags & kPasteboardClientIsOwner)
  36. + return;
  37. +
  38. + fl_trigger_clipboard_notify(1);
  39. +}
  40. /*
  41. * create a selection