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.
This commit is contained in:
Stephan Aßmus 2014-11-02 01:21:15 +01:00
parent 1f3c1ef1c5
commit dfbf4d3885

View File

@ -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);