Author: bonefish Date: 2010-11-24 17:38:31 +0100 (Wed, 24 Nov 2010) New Revision: 39610 Changeset: http://dev.haiku-os.org/changeset/39610 Modified: haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp haiku/trunk/src/servers/app/DefaultWindowBehaviour.h Log: Fixed another regression introduced in r39602: Reset the click count when a different region has been clicked since the last click. Modified: haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp =================================================================== --- haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp 2010-11-24 16:25:12 UTC (rev 39609) +++ haiku/trunk/src/servers/app/DefaultWindowBehaviour.cpp 2010-11-24 16:38:31 UTC (rev 39610) @@ -492,6 +492,7 @@ fState(NULL), fLastModifiers(0), fLastMouseButtons(0), + fLastRegion(REGION_NONE), fResetClickCount(0) { } @@ -620,6 +621,16 @@ } } + // 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. Modified: haiku/trunk/src/servers/app/DefaultWindowBehaviour.h =================================================================== --- haiku/trunk/src/servers/app/DefaultWindowBehaviour.h 2010-11-24 16:25:12 UTC (rev 39609) +++ haiku/trunk/src/servers/app/DefaultWindowBehaviour.h 2010-11-24 16:38:31 UTC (rev 39610) @@ -75,6 +75,7 @@ State* fState; int32 fLastModifiers; int32 fLastMouseButtons; + Region fLastRegion; int32 fResetClickCount; };