From 57d2e31e591b97106f9c66ce54c96bc094208a54 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 19 Aug 2012 12:46:42 +0100 Subject: Avoid using hlcache_handle for drag saves in html_interaction. Drag save msg with NULL content now means save the content which sends the message. --- desktop/browser.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index e7d39fd8b..3fe16f54c 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1456,26 +1456,27 @@ nserror browser_window_callback(hlcache_handle *c, { /* Content wants drag save of a content */ struct browser_window *root = browser_window_get_root(bw); + hlcache_handle *save = event->data.dragsave.content; + + if (save == NULL) { + save = c; + } switch(event->data.dragsave.type) { case CONTENT_SAVE_ORIG: - gui_drag_save_object(GUI_SAVE_OBJECT_ORIG, - event->data.dragsave.content, + gui_drag_save_object(GUI_SAVE_OBJECT_ORIG, save, root->window); break; case CONTENT_SAVE_NATIVE: - gui_drag_save_object(GUI_SAVE_OBJECT_NATIVE, - event->data.dragsave.content, + gui_drag_save_object(GUI_SAVE_OBJECT_NATIVE, save, root->window); break; case CONTENT_SAVE_COMPLETE: - gui_drag_save_object(GUI_SAVE_COMPLETE, - event->data.dragsave.content, + gui_drag_save_object(GUI_SAVE_COMPLETE, save, root->window); break; case CONTENT_SAVE_SOURCE: - gui_drag_save_object(GUI_SAVE_SOURCE, - event->data.dragsave.content, + gui_drag_save_object(GUI_SAVE_SOURCE, save, root->window); break; } -- cgit v1.2.3