summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Input.cxx7
-rw-r--r--src/Fl_Text_Display.cxx4
-rw-r--r--src/Fl_cocoa.mm9
3 files changed, 17 insertions, 3 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 9dcc0eed8..a7232117e 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -678,7 +678,12 @@ int Fl_Input::handle(int event) {
dnd_save_mark = mark();
dnd_save_focus = this;
// drag the data:
- copy(0); Fl::dnd();
+ copy(0);
+#ifdef __APPLE__
+ Fl_X::dnd(1);
+#else
+ Fl::dnd();
+#endif
return 1;
}
}
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 613481da0..7159a036d 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -3863,7 +3863,11 @@ int Fl_Text_Display::handle(int event) {
if (dragType==DRAG_START_DND) {
if (!Fl::event_is_click() && Fl::dnd_text_ops()) {
const char* copy = buffer()->selection_text();
+#ifdef __APPLE__
+ Fl_X::dnd(1);
+#else
Fl::dnd();
+#endif
free((void*)copy);
}
return 1;
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 495806c97..0c1736a86 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4001,7 +4001,12 @@ static NSImage *defaultDragImage(int *pwidth, int *pheight)
return image;
}
-int Fl::dnd(void)
+int Fl::dnd()
+{
+ return Fl_X::dnd(0);
+}
+
+int Fl_X::dnd(int use_selection)
{
CFDataRef text = CFDataCreate(kCFAllocatorDefault, (UInt8*)fl_selection_buffer[0], fl_selection_length[0]);
if (text==NULL) return false;
@@ -4018,7 +4023,7 @@ int Fl::dnd(void)
int width, height;
NSImage *image;
- if ( dynamic_cast<Fl_Input_*>(w) != NULL || dynamic_cast<Fl_Text_Display*>(w) != NULL) {
+ if (use_selection) {
fl_selection_buffer[0][ fl_selection_length[0] ] = 0;
image = imageFromText(fl_selection_buffer[0], &width, &height);
} else {