From 2319b6032e7f9b58bb5d6510e286052971e42eca Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 6 Jun 2008 13:58:56 +0000 Subject: + Change core to handle different front end click behaviour styles. (Act on mouse button press or on button release.) + Click hold on CSS scrollbar arrows now pauses before starting to auto-repeat. + Click hold on scrollbar wells will now auto-repeat. svn path=/trunk/netsurf/; revision=4268 --- riscos/window.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'riscos/window.c') diff --git a/riscos/window.c b/riscos/window.c index 0ae8aa077..86d51edd3 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -84,6 +84,9 @@ static bool iconise_used[64]; static int iconise_next = 0; +/** Whether a pressed mouse button has become a drag */ +static bool mouse_drag; + /** List of all browser windows. */ static struct gui_window *window_list = 0; /** GUI window which is being redrawn. Valid only during redraw. */ @@ -140,8 +143,8 @@ static void ro_gui_window_launch_url(struct gui_window *g, const char *url); static void ro_gui_window_clone_options(struct browser_window *new_bw, struct browser_window *old_bw); static browser_mouse_state ro_gui_mouse_drag_state(wimp_mouse_state buttons); -static bool ro_gui_window_import_text(struct gui_window *g, const char *filename, - bool toolbar); +static bool ro_gui_window_import_text(struct gui_window *g, + const char *filename, bool toolbar); struct update_box { int x0; @@ -3003,11 +3006,19 @@ browser_mouse_state ro_gui_mouse_click_state(wimp_mouse_state buttons) { browser_mouse_state state = 0; - if (buttons & (wimp_CLICK_SELECT)) state |= BROWSER_MOUSE_CLICK_1; - if (buttons & (wimp_CLICK_ADJUST)) state |= BROWSER_MOUSE_CLICK_2; + if (buttons & (wimp_CLICK_SELECT)) + state |= BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_CLICK_1; + if (buttons & (wimp_CLICK_ADJUST)) + state |= BROWSER_MOUSE_PRESS_2 | BROWSER_MOUSE_CLICK_2; - if (buttons & (wimp_DRAG_SELECT)) state |= BROWSER_MOUSE_DRAG_1; - if (buttons & (wimp_DRAG_ADJUST)) state |= BROWSER_MOUSE_DRAG_2; + if (buttons & (wimp_DRAG_SELECT)) { + state |= BROWSER_MOUSE_DRAG_1; + mouse_drag = true; + } + if (buttons & (wimp_DRAG_ADJUST)) { + state |= BROWSER_MOUSE_DRAG_2; + mouse_drag = true; + } if (ro_gui_shift_pressed()) state |= BROWSER_MOUSE_MOD_1; if (ro_gui_ctrl_pressed()) state |= BROWSER_MOUSE_MOD_2; @@ -3025,9 +3036,14 @@ browser_mouse_state ro_gui_mouse_drag_state(wimp_mouse_state buttons) { browser_mouse_state state = 0; + if (buttons & (wimp_CLICK_SELECT)) state |= BROWSER_MOUSE_HOLDING_1; if (buttons & (wimp_CLICK_ADJUST)) state |= BROWSER_MOUSE_HOLDING_2; + if (!(buttons & (wimp_CLICK_SELECT) || buttons & (wimp_CLICK_ADJUST))) + mouse_drag = false; + if (mouse_drag) state |= BROWSER_MOUSE_DRAG_ON; + if (ro_gui_shift_pressed()) state |= BROWSER_MOUSE_MOD_1; if (ro_gui_ctrl_pressed()) state |= BROWSER_MOUSE_MOD_2; -- cgit v1.2.3