limit the rate at which windows are moved to 50 fps, the various clients have now more time to redraw stuff
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16516 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -101,6 +101,9 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
|
|||||||
fDrawingEngine(drawingEngine),
|
fDrawingEngine(drawingEngine),
|
||||||
fDesktop(window->Desktop()),
|
fDesktop(window->Desktop()),
|
||||||
|
|
||||||
|
fLastMousePosition(0.0, 0.0),
|
||||||
|
fLastMoveTime(0),
|
||||||
|
|
||||||
fCurrentUpdateSession(),
|
fCurrentUpdateSession(),
|
||||||
fPendingUpdateSession(),
|
fPendingUpdateSession(),
|
||||||
fUpdateRequested(false),
|
fUpdateRequested(false),
|
||||||
@@ -916,6 +919,18 @@ WindowLayer::MouseMoved(BMessage *msg, BPoint where, int32* _viewToken,
|
|||||||
if (!isLatestMouseMoved)
|
if (!isLatestMouseMoved)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// limit the rate at which "mouse moved" events
|
||||||
|
// are handled that move or resize the window
|
||||||
|
if (fIsDragging || fIsResizing) {
|
||||||
|
bigtime_t now = system_time();
|
||||||
|
if (now - fLastMoveTime < 20000) {
|
||||||
|
// TODO: add a "timed event" to query for
|
||||||
|
// the then current mouse position
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fLastMoveTime = now;
|
||||||
|
}
|
||||||
|
|
||||||
if (fDecorator) {
|
if (fDecorator) {
|
||||||
BRegion visibleBorder;
|
BRegion visibleBorder;
|
||||||
GetBorderRegion(&visibleBorder);
|
GetBorderRegion(&visibleBorder);
|
||||||
@@ -976,8 +991,10 @@ WindowLayer::MouseMoved(BMessage *msg, BPoint where, int32* _viewToken,
|
|||||||
|
|
||||||
// change focus in FFM mode
|
// change focus in FFM mode
|
||||||
DesktopSettings desktopSettings(fDesktop);
|
DesktopSettings desktopSettings(fDesktop);
|
||||||
if (desktopSettings.MouseMode() != B_NORMAL_MOUSE && !IsFocus() && !(Flags() & B_AVOID_FOCUS))
|
if (desktopSettings.MouseMode() != B_NORMAL_MOUSE
|
||||||
|
&& !IsFocus() && !(Flags() & B_AVOID_FOCUS)) {
|
||||||
fDesktop->SetFocusWindow(this);
|
fDesktop->SetFocusWindow(this);
|
||||||
|
}
|
||||||
|
|
||||||
// mouse cursor
|
// mouse cursor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user