summaryrefslogtreecommitdiff
path: root/src/haiku_support.cc
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-07-28 07:28:23 +0000
committerPo Lu <luangruo@yahoo.com>2022-07-28 07:28:23 +0000
commit02ab6aaf7bc4d9c31d8e034ba3fe778bf2f35def (patch)
tree9d62d9aa3540bb1906e572ff4edff08d656ca53d /src/haiku_support.cc
parent27a0bcd7797d8059ec1b0bb000e25146bde3bf9d (diff)
downloademacs-02ab6aaf7bc4d9c31d8e034ba3fe778bf2f35def.tar.gz
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/haiku_support.cc')
-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:
float old_value;
scroll_bar_info info;
- /* True if button events should be passed to the parent. */
- bool handle_button;
+ /* How many button events were passed to the parent without
+ release. */
+ int handle_button_count;
bool in_overscroll;
bool can_overscroll;
bool maybe_overscroll;
@@ -2013,7 +2014,7 @@ public:
: BScrollBar (BRect (x, y, x1, y1), NULL, NULL, 0, 0, horizontal_p ?
B_HORIZONTAL : B_VERTICAL),
dragging (0),
- handle_button (false),
+ handle_button_count (0),
in_overscroll (false),
can_overscroll (false),
maybe_overscroll (false),
@@ -2234,10 +2235,10 @@ public:
if (message && (message->FindInt32 ("modifiers", &mods)
== B_OK)
- && mods & B_CONTROL_KEY && !handle_button)
+ && mods & B_CONTROL_KEY)
{
/* Allow C-mouse-3 to split the window on a scroll bar. */
- handle_button = true;
+ handle_button_count += 1;
SetMouseEventMask (B_POINTER_EVENTS, (B_SUSPEND_VIEW_FOCUS
| B_LOCK_WINDOW_FOCUS));
parent->BasicMouseDown (ConvertToParent (pt), this, message);
@@ -2309,9 +2310,9 @@ public:
in_overscroll = false;
maybe_overscroll = false;
- if (handle_button)
+ if (handle_button_count)
{
- handle_button = false;
+ handle_button_count--;
looper = Looper ();
msg = (looper
? looper->CurrentMessage ()