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:
parent
1f3c1ef1c5
commit
dfbf4d3885
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user