diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-05-28 22:07:33 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-05-28 22:07:33 +0100 |
commit | 6b997431d34d3711c62cf4bfe7f3456f45072273 (patch) | |
tree | ec809dd85c4178d08492d449429be73c5b98a958 /frontends/riscos/corewindow.c | |
parent | f1fdd93ffda5181f325905c8509a2bea9d78eb41 (diff) | |
download | netsurf-6b997431d34d3711c62cf4bfe7f3456f45072273.tar.gz netsurf-6b997431d34d3711c62cf4bfe7f3456f45072273.tar.bz2 |
update RISC OS frontend to use core window for local history
Diffstat (limited to 'frontends/riscos/corewindow.c')
-rw-r--r-- | frontends/riscos/corewindow.c | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c index b57e4e0eb..a885977a8 100644 --- a/frontends/riscos/corewindow.c +++ b/frontends/riscos/corewindow.c @@ -236,12 +236,7 @@ static void ro_cw_mouse_at(wimp_pointer *pointer, void *data) } LOG("RO corewindow context %p", ro_cw); - /* no futher processing required if no drag in progress */ - if (ro_cw->drag_status == CORE_WINDOW_DRAG_NONE) { - return; - } - - /* Not a Menu click and a drag is in progress. */ + /* Not a Menu click. */ state.w = pointer->w; error = xwimp_get_window_state(&state); if (error) { @@ -250,18 +245,23 @@ static void ro_cw_mouse_at(wimp_pointer *pointer, void *data) return; } - /* Convert the returned mouse coordinates into NetSurf's internal - * units. + /* Convert the returned mouse coordinates into + * NetSurf's internal units. */ xpos = ((pointer->pos.x - state.visible.x0) + state.xscroll) / 2; ypos = ((state.visible.y1 - pointer->pos.y) - state.yscroll + ro_cw->origin_y) / 2; - /* Start to process the mouse click. */ - mouse = ro_gui_mouse_drag_state(pointer->buttons, - wimp_BUTTON_DOUBLE_CLICK_DRAG); + /* if no drag in progress report hover */ + if (ro_cw->drag_status == CORE_WINDOW_DRAG_NONE) { + mouse = BROWSER_MOUSE_HOVER; + } else { + /* Start to process the mouse click. */ + mouse = ro_gui_mouse_drag_state(pointer->buttons, + wimp_BUTTON_DOUBLE_CLICK_DRAG); - ro_cw->mouse(ro_cw, mouse, xpos, ypos); + ro_cw->mouse(ro_cw, mouse, xpos, ypos); + } if (!(mouse & BROWSER_MOUSE_DRAG_ON)) { ro_cw->mouse(ro_cw, BROWSER_MOUSE_HOVER, xpos, ypos); @@ -373,6 +373,30 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw, /** + * Handle Pointer Leaving Window events. + * + * These events are delivered as the termination callback handler from + * ro_mouse's mouse tracking. + * + * \param leaving The Wimp_PointerLeavingWindow block. + * \param data NULL data pointer. + */ +static void ro_cw_pointer_leaving(wimp_leaving *leaving, void *data) +{ + struct ro_corewindow *ro_cw; + + ro_cw = (struct ro_corewindow *)ro_gui_wimp_event_get_user_data(leaving->w); + if (ro_cw == NULL) { + LOG("no corewindow conext for window: 0x%x", + (unsigned int)leaving->w); + return; + } + + ro_cw->mouse(ro_cw, BROWSER_MOUSE_LEAVE, 0, 0); +} + + +/** * Wimp callback on pointer entering window. * * The wimp has issued an event to the window because the pointer has @@ -382,7 +406,7 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw, */ static void ro_cw_pointer_entering(wimp_entering *entering) { - ro_mouse_track_start(NULL, ro_cw_mouse_at, NULL); + ro_mouse_track_start(ro_cw_pointer_leaving, ro_cw_mouse_at, NULL); } |