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. --- render/html.c | 12 ++++++++++++ render/html_interaction.c | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'render') diff --git a/render/html.c b/render/html.c index 134852fa2..db9e20810 100644 --- a/render/html.c +++ b/render/html.c @@ -1243,6 +1243,18 @@ html_object_callback(hlcache_handle *object, break; case CONTENT_MSG_DRAGSAVE: + { + union content_msg_data msg_data; + if (event->data.dragsave.content == NULL) + msg_data.dragsave.content = object; + else + msg_data.dragsave.content = + event->data.dragsave.content; + + content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, msg_data); + } + break; + case CONTENT_MSG_SAVELINK: case CONTENT_MSG_POINTER: case CONTENT_MSG_PASTE: diff --git a/render/html_interaction.c b/render/html_interaction.c index 05afeeb8d..08cab5d81 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -773,7 +773,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, if (mouse & BROWSER_MOUSE_MOD_2) { msg_data.dragsave.type = CONTENT_SAVE_COMPLETE; - msg_data.dragsave.content = h; + msg_data.dragsave.content = NULL; content_broadcast(c, CONTENT_MSG_DRAGSAVE, msg_data); @@ -793,7 +793,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, if (mouse & BROWSER_MOUSE_MOD_2) { msg_data.dragsave.type = CONTENT_SAVE_SOURCE; - msg_data.dragsave.content = h; + msg_data.dragsave.content = NULL; content_broadcast(c, CONTENT_MSG_DRAGSAVE, msg_data); -- cgit v1.2.3