diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/html.c | 16 | ||||
-rw-r--r-- | render/html_interaction.c | 20 | ||||
-rw-r--r-- | render/textinput.c | 21 | ||||
-rw-r--r-- | render/textplain.c | 21 |
4 files changed, 31 insertions, 47 deletions
diff --git a/render/html.c b/render/html.c index ed7e7ebaa..134852fa2 100644 --- a/render/html.c +++ b/render/html.c @@ -1230,7 +1230,7 @@ html_object_callback(hlcache_handle *object, break; case CONTENT_MSG_LINK: - /* Don't care about favicons */ + /* Don't care about favicons that aren't on top level content */ break; case CONTENT_MSG_SCROLL: @@ -1243,18 +1243,12 @@ html_object_callback(hlcache_handle *object, break; case CONTENT_MSG_DRAGSAVE: - /* Pass it on */ - content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, event->data); - break; - case CONTENT_MSG_SAVELINK: - /* Pass it on */ - content_broadcast(&c->base, CONTENT_MSG_SAVELINK, event->data); - break; - case CONTENT_MSG_POINTER: - /* Pass it on */ - content_broadcast(&c->base, CONTENT_MSG_POINTER, event->data); + case CONTENT_MSG_PASTE: + /* These messages are for browser window layer. + * we're not interested, so pass them on. */ + content_broadcast(&c->base, event->type, event->data); break; default: diff --git a/render/html_interaction.c b/render/html_interaction.c index b6f2dc615..f38361161 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -584,8 +584,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, DRAGGING_SELECTION, NULL); status = messages_get("Selecting"); - } else - status = content_get_status_message(h); + } } else if (mouse & BROWSER_MOUSE_PRESS_1) selection_clear(&html->sel, true); @@ -663,7 +662,6 @@ void html_mouse_action(struct content *c, struct browser_window *bw, } /* \todo should have a drag-saving object msg */ - status = content_get_status_message(h); } else if (iframe) { int pos_x, pos_y; @@ -756,10 +754,9 @@ void html_mouse_action(struct content *c, struct browser_window *bw, browser_window_set_drag_type(bw, DRAGGING_SELECTION, NULL); - status = - messages_get("Selecting"); - } else - status = content_get_status_message(h); + status = messages_get( + "Selecting"); + } done = true; } @@ -771,11 +768,6 @@ void html_mouse_action(struct content *c, struct browser_window *bw, if (!done) { if (title) status = title; - else if (bw->loading_content) - status = content_get_status_message( - bw->loading_content); - else - status = content_get_status_message(h); if (mouse & BROWSER_MOUSE_DRAG_1) { if (mouse & BROWSER_MOUSE_MOD_2) { @@ -824,12 +816,10 @@ void html_mouse_action(struct content *c, struct browser_window *bw, } } - if (status != NULL) { + if (!iframe) { msg_data.explicit_status_text = status; content_broadcast(c, CONTENT_MSG_STATUS, msg_data); - } - if (!iframe) { msg_data.pointer = pointer; content_broadcast(c, CONTENT_MSG_POINTER, msg_data); } diff --git a/render/textinput.c b/render/textinput.c index 6c580a8cd..98746bca1 100644 --- a/render/textinput.c +++ b/render/textinput.c @@ -1308,13 +1308,16 @@ bool textinput_textarea_callback(struct browser_window *bw, uint32_t key, break; case KEY_PASTE: - gui_paste_from_clipboard(bw->window, - box_x + inline_container->x + - text_box->x + pixel_offset, - box_y + inline_container->y + text_box->y); + { + union content_msg_data msg_data; + msg_data.paste.x = box_x + inline_container->x + + text_box->x + pixel_offset; + msg_data.paste.y = box_y + inline_container->y + text_box->y; + content_broadcast(c, CONTENT_MSG_PASTE, msg_data); /* screen updated and caret repositioned already */ return true; + } case KEY_CUT_SELECTION: { @@ -1949,12 +1952,16 @@ bool textinput_input_callback(struct browser_window *bw, uint32_t key, break; case KEY_PASTE: - gui_paste_from_clipboard(bw->window, - box_x + input->children->x + text_box->x + pixel_offset, - box_y + input->children->y + text_box->y); + { + union content_msg_data msg_data; + msg_data.paste.x = box_x + input->children->x + text_box->x + + pixel_offset; + msg_data.paste.y = box_y + input->children->y + text_box->y; + content_broadcast(c, CONTENT_MSG_PASTE, msg_data); /* screen updated and caret repositioned already */ return true; + } case KEY_CUT_SELECTION: { diff --git a/render/textplain.c b/render/textplain.c index 71d576579..ec4d486e5 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -628,7 +628,7 @@ void textplain_mouse_track(struct content *c, struct browser_window *bw, { textplain_content *text = (textplain_content *) c; - if (bw->drag_type == DRAGGING_SELECTION && !mouse) { + if (browser_window_get_drag_type(bw) == DRAGGING_SELECTION && !mouse) { int dir = -1; size_t idx; @@ -641,7 +641,7 @@ void textplain_mouse_track(struct content *c, struct browser_window *bw, browser_window_set_drag_type(bw, DRAGGING_NONE, NULL); } - switch (bw->drag_type) { + switch (browser_window_get_drag_type(bw)) { case DRAGGING_SELECTION: { int dir = -1; @@ -687,27 +687,20 @@ void textplain_mouse_action(struct content *c, struct browser_window *bw, if (selection_click(&text->sel, mouse, idx)) { if (selection_dragging(&text->sel)) { - bw->drag_type = DRAGGING_SELECTION; + browser_window_set_drag_type(bw, + DRAGGING_SELECTION, NULL); status = messages_get("Selecting"); } - else - status = content__get_status_message(c); - } - else { - if (bw->loading_content) - status = content_get_status_message( - bw->loading_content); - else - status = content__get_status_message(c); + } else { if (mouse & (BROWSER_MOUSE_DRAG_1 | BROWSER_MOUSE_DRAG_2)) { browser_window_page_drag_start(bw, x, y); pointer = BROWSER_POINTER_MOVE; } } - if (status != NULL) - browser_window_set_status(bw, status); + msg_data.explicit_status_text = status; + content_broadcast(c, CONTENT_MSG_STATUS, msg_data); msg_data.pointer = pointer; content_broadcast(c, CONTENT_MSG_POINTER, msg_data); |