diff --git a/src/servers/app/DefaultWindowBehaviour.cpp b/src/servers/app/DefaultWindowBehaviour.cpp index 39479fe4a1..6818b95728 100644 --- a/src/servers/app/DefaultWindowBehaviour.cpp +++ b/src/servers/app/DefaultWindowBehaviour.cpp @@ -492,6 +492,7 @@ DefaultWindowBehaviour::DefaultWindowBehaviour(Window* window) fState(NULL), fLastModifiers(0), fLastMouseButtons(0), + fLastRegion(REGION_NONE), fResetClickCount(0) { } @@ -620,6 +621,16 @@ DefaultWindowBehaviour::MouseDown(BMessage* message, BPoint where) } } + // The hit region changed since the last the click. Reset the click count. + if (hitRegion != fLastRegion) { + fLastRegion = hitRegion; + clickCount = 1; + + fResetClickCount = message->FindInt32("clicks") - 1; + if (fResetClickCount < 0) + fResetClickCount = 0; + } + if (action == CLICK_NONE) { // No action -- if this is a click inside the window's contents, // let it be forwarded to the window. diff --git a/src/servers/app/DefaultWindowBehaviour.h b/src/servers/app/DefaultWindowBehaviour.h index 3c2175982c..5f1261af73 100644 --- a/src/servers/app/DefaultWindowBehaviour.h +++ b/src/servers/app/DefaultWindowBehaviour.h @@ -75,6 +75,7 @@ protected: State* fState; int32 fLastModifiers; int32 fLastMouseButtons; + Region fLastRegion; int32 fResetClickCount; };