summaryrefslogtreecommitdiff
path: root/riscos/window.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-06-06 13:58:56 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-06-06 13:58:56 +0000
commit2319b6032e7f9b58bb5d6510e286052971e42eca (patch)
treed99fb03fd986d16c2e437c289a45deafb18d1c6c /riscos/window.c
parentf1b1a9737fecf026fa335a84e7345227cb822df3 (diff)
downloadnetsurf-2319b6032e7f9b58bb5d6510e286052971e42eca.tar.gz
netsurf-2319b6032e7f9b58bb5d6510e286052971e42eca.tar.bz2
+ 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
Diffstat (limited to 'riscos/window.c')
-rw-r--r--riscos/window.c28
1 files changed, 22 insertions, 6 deletions
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;