Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/57d2e31e591b97106f9c66ce54c96bc094208a54
...commit
http://git.netsurf-browser.org/netsurf.git/commit/57d2e31e591b97106f9c66ce54c96bc094208a54
...tree
http://git.netsurf-browser.org/netsurf.git/tree/57d2e31e591b97106f9c66ce54c96bc094208a54
The branch, master has been updated
via 57d2e31e591b97106f9c66ce54c96bc094208a54 (commit)
from 762cade3622a4295c7209307a4626773bd6bc7c0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/57d2e31e591b97106f9c66ce54c96bc094208a54
commit 57d2e31e591b97106f9c66ce54c96bc094208a54
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
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.
diff --git a/content/content.h b/content/content.h
index 19ec791..8987e2c 100644
--- a/content/content.h
+++ b/content/content.h
@@ -140,6 +140,7 @@ union content_msg_data {
CONTENT_SAVE_COMPLETE,
CONTENT_SAVE_SOURCE
} type;
+ /** if NULL, save the content generating the message */
struct hlcache_handle *content;
} dragsave;
/** CONTENT_MSG_SAVELINK - Save a URL */
diff --git a/desktop/browser.c b/desktop/browser.c
index e7d39fd..3fe16f5 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;
}
diff --git a/render/html.c b/render/html.c
index 134852f..db9e208 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 05afeeb..08cab5d 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);
-----------------------------------------------------------------------
Summary of changes:
content/content.h | 1 +
desktop/browser.c | 17 +++++++++--------
render/html.c | 12 ++++++++++++
render/html_interaction.c | 4 ++--
4 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/content/content.h b/content/content.h
index 19ec791..8987e2c 100644
--- a/content/content.h
+++ b/content/content.h
@@ -140,6 +140,7 @@ union content_msg_data {
CONTENT_SAVE_COMPLETE,
CONTENT_SAVE_SOURCE
} type;
+ /** if NULL, save the content generating the message */
struct hlcache_handle *content;
} dragsave;
/** CONTENT_MSG_SAVELINK - Save a URL */
diff --git a/desktop/browser.c b/desktop/browser.c
index e7d39fd..3fe16f5 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;
}
diff --git a/render/html.c b/render/html.c
index 134852f..db9e208 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 05afeeb..08cab5d 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);
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org