mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 14:59:47 +03:00
Frame drag start function can take child bw. Don't need to get root bw in html handler. Avoids bw dereferences.
This commit is contained in:
parent
195a77a4cd
commit
6daf6c178d
@ -933,5 +933,11 @@ bool browser_window_frame_resize_start(struct browser_window *bw,
|
||||
browser_mouse_state mouse, int x, int y,
|
||||
gui_pointer_shape *pointer)
|
||||
{
|
||||
return browser_window_resize_frames(bw, mouse, x, y, pointer);
|
||||
struct browser_window *root = browser_window_get_root(bw);
|
||||
int offx, offy;
|
||||
|
||||
browser_window_get_position(bw, true, &offx, &offy);
|
||||
|
||||
return browser_window_resize_frames(root, mouse,
|
||||
x + offx, y + offy, pointer);
|
||||
}
|
||||
|
@ -581,19 +581,13 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
|
||||
bool done = false;
|
||||
|
||||
/* frame resizing */
|
||||
if (bw->parent) {
|
||||
struct browser_window *parent;
|
||||
for (parent = bw->parent; parent->parent;
|
||||
parent = parent->parent);
|
||||
if (browser_window_frame_resize_start(parent, mouse,
|
||||
x + bw->x, y + bw->y,
|
||||
&pointer)) {
|
||||
if (mouse & (BROWSER_MOUSE_DRAG_1 |
|
||||
BROWSER_MOUSE_DRAG_2)) {
|
||||
status = messages_get("FrameDrag");
|
||||
}
|
||||
done = true;
|
||||
if (browser_window_frame_resize_start(bw, mouse, x, y,
|
||||
&pointer)) {
|
||||
if (mouse & (BROWSER_MOUSE_DRAG_1 |
|
||||
BROWSER_MOUSE_DRAG_2)) {
|
||||
status = messages_get("FrameDrag");
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
|
||||
/* if clicking in the main page, remove the selection from any
|
||||
|
Loading…
Reference in New Issue
Block a user