diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/html.c | 6 | ||||
-rw-r--r-- | render/textplain.c | 21 |
2 files changed, 25 insertions, 2 deletions
diff --git a/render/html.c b/render/html.c index a45e26b7e..d77cfd981 100644 --- a/render/html.c +++ b/render/html.c @@ -34,6 +34,7 @@ #include "desktop/browser.h" #include "desktop/gui.h" #include "desktop/options.h" +#include "desktop/selection.h" #include "image/bitmap.h" #include "render/box.h" #include "render/font.h" @@ -1929,6 +1930,8 @@ void html_open(struct content *c, struct browser_window *bw, html->page = (html_content *) page; html->box = box; + selection_set_browser_window(bw->sel, bw); + for (object = html->object_list; object != NULL; object = next) { next = object->next; @@ -1955,6 +1958,9 @@ void html_close(struct content *c) html_content *html = (html_content *) c; struct content_html_object *object, *next; + if (html->bw && html->bw->sel) + selection_set_browser_window(html->bw->sel, NULL); + html->bw = NULL; for (object = html->object_list; object != NULL; object = next) { diff --git a/render/textplain.c b/render/textplain.c index dca563178..6827ab5d8 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -108,6 +108,7 @@ static bool textplain_redraw(struct content *c, struct content_redraw_data *data static void textplain_open(struct content *c, struct browser_window *bw, struct content *page, struct box *box, struct object_params *params); +void textplain_close(struct content *c); static nserror textplain_clone(const struct content *old, struct content **newc); static content_type textplain_content_type(lwc_string *mime_type); @@ -132,6 +133,7 @@ static const content_handler textplain_content_handler = { .mouse_action = textplain_mouse_action, .redraw = textplain_redraw, .open = textplain_open, + .close = textplain_close, .clone = textplain_clone, .type = textplain_content_type, .no_share = true, @@ -820,9 +822,24 @@ void textplain_open(struct content *c, struct browser_window *bw, struct content *page, struct box *box, struct object_params *params) { - textplain_content *textplain = (textplain_content *) c; + textplain_content *text = (textplain_content *) c; + + text->bw = bw; +} + + +/** + * Handle a window containing a CONTENT_TEXTPLAIN being closed. + */ + +void textplain_close(struct content *c) +{ + textplain_content *text = (textplain_content *) c; + + if (text->bw && text->bw->sel) + selection_set_browser_window(text->bw->sel, NULL); - textplain->bw = bw; + text->bw = NULL; } /** |