* Finally rewrote the filthy, busy-looping, mouse tracking in Tracker.
The new asynchronous tracking doesn't lock the view and makes desktop replicants happy while clicking and dragging around. Fixes #880, #7241 and certainly other tickets, that i will revisit, about refresh locks on the desktop or mouse related bugs. Based on a reusable MessageFilter and the recent B_MOUSE_IDLE message. Some parts are ported from the old code and could use further simplification. There should be no intentional user fonctional change, except: - slightly bigger threshold radius, shorter duration thresholds (= 1.0 x the system-wide doubleclick setting) - not reimplemented: quickening threshold when holding shift while dragging a pose over a destination pose. Some parts are ported from the old code and could use further simplification. There is one known minor regression with autoscrolling while rect-selecting but that will be better fixed with some changes to the autoscroll code. Will address that ASAP. As for the unknown regressions, please test :) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41892 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2009, Alexandre Deckner, [email protected]
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef LONG_AND_DRAG_TRACKING_FILTER_H
|
||||
#define LONG_AND_DRAG_TRACKING_FILTER_H
|
||||
|
||||
|
||||
#include <MessageFilter.h>
|
||||
#include <Point.h>
|
||||
|
||||
|
||||
class BHandler;
|
||||
class BMessageRunner;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
class LongAndDragTrackingFilter : public BMessageFilter {
|
||||
public:
|
||||
LongAndDragTrackingFilter(
|
||||
uint32 longMessageWhat,
|
||||
uint32 dragMessageWhat,
|
||||
float radiusThreshold = 4.0f,
|
||||
bigtime_t durationThreshold = 0);
|
||||
~LongAndDragTrackingFilter();
|
||||
|
||||
filter_result Filter(BMessage* message, BHandler** target);
|
||||
|
||||
private:
|
||||
void _StopTracking();
|
||||
|
||||
uint32 fLongMessageWhat;
|
||||
uint32 fDragMessageWhat;
|
||||
BMessageRunner* fMessageRunner;
|
||||
BPoint fClickPoint;
|
||||
uint32 fClickButtons;
|
||||
float fSquaredRadiusThreshold;
|
||||
bigtime_t fDurationThreshold;
|
||||
};
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
using BPrivate::LongAndDragTrackingFilter;
|
||||
|
||||
#endif // LONG_AND_DRAG_TRACKING_FILTER_H
|
||||
|
||||
Reference in New Issue
Block a user