From dfbf4d3885af5855811bd3d9a19c5e3baff0ee03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 2 Nov 2014 01:21:15 +0100 Subject: [PATCH] HaikuDepot: Fix click detection in featured packages Take window activation and parent bounds (a featured package scrolled outside the visible region within the parent) into account. --- src/apps/haikudepot/ui/FeaturedPackagesView.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp index e502284bbe..e7978c58cd 100644 --- a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp +++ b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp @@ -111,7 +111,12 @@ public: virtual void MouseDown(BPoint where) { - if (Bounds().Contains(where)) { + BRect bounds = Bounds(); + BRect parentBounds = Parent()->Bounds(); + ConvertFromParent(&parentBounds); + bounds = bounds & parentBounds; + + if (bounds.Contains(where) && Window()->IsActive()) { BMessage message(MSG_PACKAGE_SELECTED); message.AddString("title", PackageTitle()); Window()->PostMessage(&message);