From 98c0eab3d478752b6bf53f92542edc0bb04d77bf Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 24 Nov 2010 16:38:31 +0000 Subject: [PATCH] Fixed another regression introduced in r39602: Reset the click count when a different region has been clicked since the last click. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39610 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/DefaultWindowBehaviour.cpp | 11 +++++++++++ src/servers/app/DefaultWindowBehaviour.h | 1 + 2 files changed, 12 insertions(+) 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; };