summaryrefslogtreecommitdiff
path: root/desktop/tree.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-12-15 21:58:01 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-12-15 21:58:01 +0000
commitcbe24279f854094a96b9b265d9983ee4e7401a05 (patch)
tree9d6f3f984dd1359f68ee5611bb2169fcf1b4e464 /desktop/tree.c
parent95870c95ddcf64969893ac06d4439fb9e4ab067c (diff)
downloadnetsurf-cbe24279f854094a96b9b265d9983ee4e7401a05.tar.gz
netsurf-cbe24279f854094a96b9b265d9983ee4e7401a05.tar.bz2
Don't give up on a mouse action because BROWSER_MOUSE_PRESS_{1|2} is set. The RISC OS front end sets them for action-on-button-press (rather than release) behaviour.
svn path=/trunk/netsurf/; revision=11065
Diffstat (limited to 'desktop/tree.c')
-rw-r--r--desktop/tree.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/desktop/tree.c b/desktop/tree.c
index e06992fd2..46db6018d 100644
--- a/desktop/tree.c
+++ b/desktop/tree.c
@@ -2107,9 +2107,9 @@ bool tree_mouse_action(struct tree *tree, browser_mouse_state mouse, int x,
y1 = tree->editing->box.y + tree->editing->box.height;
if (tree->textarea_drag_start &&
- (mouse & (BROWSER_MOUSE_HOLDING_1 |
- BROWSER_MOUSE_HOLDING_2))) {
-
+ (mouse & (BROWSER_MOUSE_HOLDING_1 |
+ BROWSER_MOUSE_HOLDING_2))) {
+ /* Track the drag path */
textarea_mouse_action(tree->textarea, mouse,
x - x0, y - y0);
return true;
@@ -2118,12 +2118,15 @@ bool tree_mouse_action(struct tree *tree, browser_mouse_state mouse, int x,
if ((x >= x0) && (x < x1) && (y >= y0) && (y < y1)) {
-
+ /* Inside the textarea */
if (mouse & (BROWSER_MOUSE_DRAG_1 |
- BROWSER_MOUSE_DRAG_2))
+ BROWSER_MOUSE_DRAG_2)) {
+ /* Drag starting */
tree->textarea_drag_start = true;
- else
+ } else {
+ /* Other action */
tree->textarea_drag_start = false;
+ }
textarea_mouse_action(tree->textarea, mouse,
x - x0, y - y0);
return true;
@@ -2133,9 +2136,8 @@ bool tree_mouse_action(struct tree *tree, browser_mouse_state mouse, int x,
tree->textarea_drag_start = false;
- /* we are not interested in the drag path or in mouse presses, return */
- if (mouse & (BROWSER_MOUSE_HOLDING_1 | BROWSER_MOUSE_HOLDING_2 |
- BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_PRESS_2))
+ /* we are not interested in the drag path, return */
+ if (mouse & (BROWSER_MOUSE_HOLDING_1 | BROWSER_MOUSE_HOLDING_2))
return true;
/* cancel edit */