summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/drag.c2
-rw-r--r--atari/gui.c2
-rw-r--r--beos/window.cpp2
-rw-r--r--cocoa/gui.m2
-rw-r--r--desktop/gui.h3
-rw-r--r--desktop/selection.c5
-rw-r--r--framebuffer/gui.c2
-rw-r--r--gtk/window.c2
-rw-r--r--monkey/browser.c2
-rw-r--r--riscos/save.c7
-rw-r--r--windows/gui.c3
11 files changed, 18 insertions, 14 deletions
diff --git a/amiga/drag.c b/amiga/drag.c
index 45b0843dd..8051cc3c8 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -89,7 +89,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
drag_save = type;
}
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
ami_drag_icon_show(g->shared->win, "ascii");
diff --git a/atari/gui.c b/atari/gui.c
index db44c0ae3..cff608291 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -661,7 +661,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
TODO();
}
-void gui_drag_save_selection(struct selection *s, struct gui_window *w)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
LOG((""));
TODO();
diff --git a/beos/window.cpp b/beos/window.cpp
index 1e564a173..27d68f33b 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -1297,7 +1297,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
}
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
}
diff --git a/cocoa/gui.m b/cocoa/gui.m
index cd7e6d239..fed4da805 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -291,7 +291,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
{
}
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
}
diff --git a/desktop/gui.h b/desktop/gui.h
index b38bb61d5..f4b8b7215 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -50,7 +50,6 @@ typedef enum {
struct gui_window;
struct gui_download_window;
struct browser_window;
-struct selection;
struct form_control;
#include <stdbool.h>
@@ -116,7 +115,7 @@ void gui_download_window_done(struct gui_download_window *dw);
void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
struct gui_window *g);
-void gui_drag_save_selection(struct selection *s, struct gui_window *g);
+void gui_drag_save_selection(struct gui_window *g, const char *selection);
void gui_start_selection(struct gui_window *g);
void gui_clear_selection(struct gui_window *g);
diff --git a/desktop/selection.c b/desktop/selection.c
index 1b85a090c..13a1293e3 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -273,8 +273,9 @@ bool selection_click(struct selection *s, browser_mouse_state mouse,
((mouse & BROWSER_MOUSE_DRAG_1) ||
(modkeys && (mouse & BROWSER_MOUSE_DRAG_2)))) {
/* drag-saving selection */
-
- gui_drag_save_selection(s, top->window);
+ char *sel = selection_get_copy(s);
+ gui_drag_save_selection(top->window, sel);
+ free(sel);
}
else if (!modkeys) {
if (pos && (mouse & BROWSER_MOUSE_PRESS_1)) {
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 432c29855..d0634750d 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -1844,7 +1844,7 @@ gui_drag_save_object(gui_save_type type,
}
void
-gui_drag_save_selection(struct selection *s, struct gui_window *g)
+gui_drag_save_selection(struct gui_window *g, const char *selection)
{
}
diff --git a/gtk/window.c b/gtk/window.c
index 663ff32a3..8b7d2f912 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -1080,7 +1080,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
}
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
}
diff --git a/monkey/browser.c b/monkey/browser.c
index 9d87f4471..09ecf4b11 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -314,7 +314,7 @@ gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
}
void
-gui_drag_save_selection(struct selection *s, struct gui_window *g)
+gui_drag_save_selection(struct gui_window *g, const char *selection)
{
}
diff --git a/riscos/save.c b/riscos/save.c
index 549a2ab3e..47006d287 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -395,7 +395,7 @@ void gui_drag_save_object(gui_save_type save_type, hlcache_handle *c,
* \param g gui window
*/
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
wimp_pointer pointer;
char icon_buf[20];
@@ -421,7 +421,10 @@ void gui_drag_save_selection(struct selection *s, struct gui_window *g)
if (gui_save_selection == NULL)
free(gui_save_selection);
- gui_save_selection = selection_get_copy(s);
+ if (selection == NULL)
+ gui_save_selection = strdup("");
+ else
+ gui_save_selection = strdup(selection);
ro_gui_save_set_state(NULL, GUI_SAVE_TEXT_SELECTION, NULL,
save_leafname, LEAFNAME_MAX,
diff --git a/windows/gui.c b/windows/gui.c
index 313da5423..63855e0c7 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -1766,7 +1766,8 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
{
}
-void gui_drag_save_selection(struct selection *s, struct gui_window *w)
+
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
{
}