aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-07-28 07:28:23 +0000
committerPo Lu2022-07-28 07:28:23 +0000
commit02ab6aaf7bc4d9c31d8e034ba3fe778bf2f35def (patch)
tree9d62d9aa3540bb1906e572ff4edff08d656ca53d /src
parent27a0bcd7797d8059ec1b0bb000e25146bde3bf9d (diff)
downloademacs-02ab6aaf7bc4d9c31d8e034ba3fe778bf2f35def.tar.gz
emacs-02ab6aaf7bc4d9c31d8e034ba3fe778bf2f35def.zip
Fix minor problem with scroll bar grabs on Haiku
* haiku_support.cc (class EmacsScrollBar, EmacsScrollBar) (MouseDown, MouseUp): Keep a counter of the mouse down events received.
Diffstat (limited to 'src')
-rw-r--r--src/haiku_support.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index 204fdb81c2d..cb378d2d810 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -1996,8 +1996,9 @@ public:
1996 float old_value; 1996 float old_value;
1997 scroll_bar_info info; 1997 scroll_bar_info info;
1998 1998
1999 /* True if button events should be passed to the parent. */ 1999 /* How many button events were passed to the parent without
2000 bool handle_button; 2000 release. */
2001 int handle_button_count;
2001 bool in_overscroll; 2002 bool in_overscroll;
2002 bool can_overscroll; 2003 bool can_overscroll;
2003 bool maybe_overscroll; 2004 bool maybe_overscroll;
@@ -2013,7 +2014,7 @@ public:
2013 : BScrollBar (BRect (x, y, x1, y1), NULL, NULL, 0, 0, horizontal_p ? 2014 : BScrollBar (BRect (x, y, x1, y1), NULL, NULL, 0, 0, horizontal_p ?
2014 B_HORIZONTAL : B_VERTICAL), 2015 B_HORIZONTAL : B_VERTICAL),
2015 dragging (0), 2016 dragging (0),
2016 handle_button (false), 2017 handle_button_count (0),
2017 in_overscroll (false), 2018 in_overscroll (false),
2018 can_overscroll (false), 2019 can_overscroll (false),
2019 maybe_overscroll (false), 2020 maybe_overscroll (false),
@@ -2234,10 +2235,10 @@ public:
2234 2235
2235 if (message && (message->FindInt32 ("modifiers", &mods) 2236 if (message && (message->FindInt32 ("modifiers", &mods)
2236 == B_OK) 2237 == B_OK)
2237 && mods & B_CONTROL_KEY && !handle_button) 2238 && mods & B_CONTROL_KEY)
2238 { 2239 {
2239 /* Allow C-mouse-3 to split the window on a scroll bar. */ 2240 /* Allow C-mouse-3 to split the window on a scroll bar. */
2240 handle_button = true; 2241 handle_button_count += 1;
2241 SetMouseEventMask (B_POINTER_EVENTS, (B_SUSPEND_VIEW_FOCUS 2242 SetMouseEventMask (B_POINTER_EVENTS, (B_SUSPEND_VIEW_FOCUS
2242 | B_LOCK_WINDOW_FOCUS)); 2243 | B_LOCK_WINDOW_FOCUS));
2243 parent->BasicMouseDown (ConvertToParent (pt), this, message); 2244 parent->BasicMouseDown (ConvertToParent (pt), this, message);
@@ -2309,9 +2310,9 @@ public:
2309 in_overscroll = false; 2310 in_overscroll = false;
2310 maybe_overscroll = false; 2311 maybe_overscroll = false;
2311 2312
2312 if (handle_button) 2313 if (handle_button_count)
2313 { 2314 {
2314 handle_button = false; 2315 handle_button_count--;
2315 looper = Looper (); 2316 looper = Looper ();
2316 msg = (looper 2317 msg = (looper
2317 ? looper->CurrentMessage () 2318 ? looper->CurrentMessage ()