DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2636
Version: 1.3-feature
Attached file "fltk-1.3.x-clipboard-osx.patch"...
Link: http://www.fltk.org/str.php?L2636
Version: 1.3-feature
diff -up fltk-1.3.x-r8659/src/Fl_cocoa.mm.orig fltk-1.3.x-r8659/src/Fl_cocoa.mm
--- fltk-1.3.x-r8659/src/Fl_cocoa.mm.orig 2011-05-19 14:22:48.558149919
+0200
+++ fltk-1.3.x-r8659/src/Fl_cocoa.mm 2011-05-19 14:23:49.938366416 +0200
@@ -1282,9 +1282,13 @@ extern "C" {
}
@end
+static void clipboard_check(void);
+
@implementation FLApplication
+ (void)sendEvent:(NSEvent *)theEvent
{
+ // update clipboard status
+ clipboard_check();
NSEventType type = [theEvent type];
if (type == NSLeftMouseDown) {
fl_lock_function();
@@ -2647,6 +2651,27 @@ void Fl::paste(Fl_Widget &receiver, int
receiver.handle(FL_PASTE);
}
+extern void fl_trigger_clipboard_notify(int source);
+
+void fl_clipboard_notify_change() {
+ // No need to do anything here...
+}
+
+static void clipboard_check(void)
+{
+ PasteboardSyncFlags flags;
+
+ allocatePasteboard();
+ flags = PasteboardSynchronize(myPasteboard);
+
+ if (!(flags & kPasteboardModified))
+ return;
+ if (flags & kPasteboardClientIsOwner)
+ return;
+
+ fl_trigger_clipboard_notify(1);
+}
+
void Fl::add_timeout(double time, Fl_Timeout_Handler cb, void* data)
{
// check, if this timer slot exists already
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev