From bd98bd9555d898df3b187be6bb02c8d4eee750bc Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 20 Jan 2009 01:07:42 +0000 Subject: [PATCH] Slightly tweak the volume slider's tracking logic to keep attention on the mouse even if it exits the view. This allows click dragging without having to be quite as precise. Fixes ticket #3317. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28962 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/desklink/VolumeSlider.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/desklink/VolumeSlider.cpp b/src/bin/desklink/VolumeSlider.cpp index b5352bb246..4118d3386a 100644 --- a/src/bin/desklink/VolumeSlider.cpp +++ b/src/bin/desklink/VolumeSlider.cpp @@ -324,6 +324,7 @@ SliderView::SliderView(BRect rect, BMessage *msg, const char *title, SetTracking(true); SetValue(value); + SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); } @@ -400,17 +401,16 @@ SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) if (!IsTracking()) return; - uint32 mouseButtons; - BPoint where; - GetMouse(&where, &mouseButtons, true); + int32 mouseButtons; + Window()->CurrentMessage()->FindInt32("buttons", &mouseButtons); // button not pressed, exit - if (! (mouseButtons & B_PRIMARY_MOUSE_BUTTON)) { + if (!(mouseButtons & B_PRIMARY_MOUSE_BUTTON)) { Invoke(); SetTracking(false); } - if (Value() == -1 || !Bounds().InsetBySelf(2, 2).Contains(point)) + if (Value() == -1) return; float v = MIN(MAX(point.x, 11), 192);