From ae39b9f9551f39a07780453832fdf229fdea3552 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 17 Nov 2019 10:12:37 +0000 Subject: move more select menu handling into mouse_action_select_menu() --- content/handlers/html/interaction.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'content') diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c index 930c79593..f238341f7 100644 --- a/content/handlers/html/interaction.c +++ b/content/handlers/html/interaction.c @@ -334,9 +334,16 @@ mouse_action_select_menu(html_content *html, const char *status; int width, height; struct hlcache_handle *bw_content; + browser_drag_type bw_drag_type; assert(html->visible_select_menu != NULL); + bw_drag_type = browser_window_get_drag_type(bw); + if (bw_drag_type != DRAGGING_NONE && !mouse) { + /* drag end: select menu */ + form_select_mouse_drag_end(html->visible_select_menu, mouse, x, y); + } + box = html->visible_select_menu->box; box_coords(box, &box_x, &box_y); @@ -542,7 +549,6 @@ html_mouse_action(struct content *c, plot_font_style_t fstyle; int scroll_mouse_x = 0, scroll_mouse_y = 0; int padding_left, padding_right, padding_top, padding_bottom; - browser_drag_type drag_type = browser_window_get_drag_type(bw); union content_msg_data msg_data; struct dom_node *node = html->layout->node; /* Default to the */ union html_selection_owner sel_owner; @@ -552,13 +558,6 @@ html_mouse_action(struct content *c, nserror res = NSERROR_OK; - if (drag_type != DRAGGING_NONE && !mouse && - html->visible_select_menu != NULL) { - /* drag end: select menu */ - form_select_mouse_drag_end(html->visible_select_menu, - mouse, x, y); - } - if (html->visible_select_menu != NULL) { return mouse_action_select_menu(html, bw, mouse, x, y); } -- cgit v1.2.3