move mouse movement handling to common place and make it cope with
passing movement to browser window if inside svn path=/trunk/netsurf/; revision=6475
This commit is contained in:
parent
ce23bb867b
commit
81cd7ce209
|
@ -139,9 +139,7 @@ void fb_os_input(struct gui_window *g, bool active)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
fb_cursor_move_abs(framebuffer,
|
fb_rootwindow_move_abs(framebuffer, g, event.motion.x, event.motion.y);
|
||||||
event.motion.x,
|
|
||||||
event.motion.y);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
|
|
|
@ -425,6 +425,29 @@ fb_rootwindow_click(struct gui_window *g, browser_mouse_state st, int x, int y)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
fb_rootwindow_move_abs(framebuffer_t *fb, struct gui_window *g, int x, int y)
|
||||||
|
{
|
||||||
|
struct fb_widget *widget;
|
||||||
|
|
||||||
|
fb_cursor_move_abs(fb, x, y);
|
||||||
|
|
||||||
|
widget = widget_list;
|
||||||
|
while (widget != NULL) {
|
||||||
|
if ((x > widget->x) &&
|
||||||
|
(y > widget->y) &&
|
||||||
|
(x < widget->x + widget->width) &&
|
||||||
|
(y < widget->y + widget->height)) {
|
||||||
|
|
||||||
|
if (widget->g == g) {
|
||||||
|
browser_window_mouse_track(g->bw, 0, x - widget->x, y - widget->y);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
widget = widget->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
|
|
Loading…
Reference in New Issue