From c08ee820764673bb6d8ac367f8637d040adf7fa2 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 10 Jan 2012 22:02:19 +0000 Subject: Allow drag handlers to inform browser window layer of any pointer range constraints. svn path=/trunk/netsurf/; revision=13394 --- render/form.c | 12 +++++++++++- render/html_interaction.c | 15 ++++++++++++--- render/textplain.c | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'render') diff --git a/render/form.c b/render/form.c index d11630192..9724c4c4c 100644 --- a/render/form.c +++ b/render/form.c @@ -1287,7 +1287,16 @@ void form_select_menu_scroll_callback(void *client_data, menu->height); break; case SCROLLBAR_MSG_SCROLL_START: - browser_window_set_drag_type(html->bw, DRAGGING_OTHER); + { + struct rect rect = { + .x0 = scrollbar_data->x0, + .y0 = scrollbar_data->y0, + .x1 = scrollbar_data->x1, + .y1 = scrollbar_data->y1 + }; + + browser_window_set_drag_type(html->bw, DRAGGING_OTHER, + &rect); menu->scroll_capture = true; @@ -1295,6 +1304,7 @@ void form_select_menu_scroll_callback(void *client_data, gui_window_box_scroll_start(root_bw->window, scrollbar_data->x0, scrollbar_data->y0, scrollbar_data->x1, scrollbar_data->y1); + } break; case SCROLLBAR_MSG_SCROLL_FINISHED: menu->scroll_capture = false; diff --git a/render/html_interaction.c b/render/html_interaction.c index b6508570f..2bec3d26a 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -108,7 +108,7 @@ void html_mouse_track(struct content *c, struct browser_window *bw, if (idx != 0) selection_track(&html->sel, mouse, idx); - browser_window_set_drag_type(bw, DRAGGING_NONE); + browser_window_set_drag_type(bw, DRAGGING_NONE, NULL); } switch (bw->drag_type) { @@ -255,7 +255,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, } /* Content related drags handled by now */ - browser_window_set_drag_type(bw, DRAGGING_NONE); + browser_window_set_drag_type(bw, DRAGGING_NONE, NULL); /* search the box tree for a link, imagemap, form control, or * box with scrollbars */ @@ -849,7 +849,15 @@ void html_overflow_scroll_callback(void *client_data, html_redraw_a_box(html->bw->current_content, box); break; case SCROLLBAR_MSG_SCROLL_START: - browser_window_set_drag_type(html->bw, DRAGGING_OTHER); + { + struct rect rect = { + .x0 = scrollbar_data->x0, + .y0 = scrollbar_data->y0, + .x1 = scrollbar_data->x1, + .y1 = scrollbar_data->y1 + }; + browser_window_set_drag_type(html->bw, DRAGGING_OTHER, + &rect); html->scrollbar = scrollbar_data->scrollbar; @@ -857,6 +865,7 @@ void html_overflow_scroll_callback(void *client_data, gui_window_box_scroll_start(root_bw->window, scrollbar_data->x0, scrollbar_data->y0, scrollbar_data->x1, scrollbar_data->y1); + } break; case SCROLLBAR_MSG_SCROLL_FINISHED: html->scrollbar = NULL; diff --git a/render/textplain.c b/render/textplain.c index 3294d536a..eabc19b20 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -638,7 +638,7 @@ void textplain_mouse_track(struct content *c, struct browser_window *bw, idx = textplain_offset_from_coords(c, x, y, dir); selection_track(&text->sel, mouse, idx); - browser_window_set_drag_type(bw, DRAGGING_NONE); + browser_window_set_drag_type(bw, DRAGGING_NONE, NULL); } switch (bw->drag_type) { @@ -680,7 +680,7 @@ void textplain_mouse_action(struct content *c, struct browser_window *bw, size_t idx; int dir = 0; - browser_window_set_drag_type(bw, DRAGGING_NONE); + browser_window_set_drag_type(bw, DRAGGING_NONE, NULL); idx = textplain_offset_from_coords(c, x, y, dir); if (selection_click(&text->sel, mouse, idx)) { -- cgit v1.2.3