HaikuDepot: Fix Oscillating Pkg Selection

The views for prominent and list packages were both
getting mouse click events and they were both sending
the "package changed" to the MainWindow which, with
the two queued messages, ended up in a feedback loop
constantly oscillating between the two packages from
the two views.  This problem is resolved in this
commit by stopping one of the views processing the
events if it is hidden -- because it is not the
selected tab.

Resolves #15884

Change-Id: I38f75baba26b26183fd0cd1a6909e404f9f37b9b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2498
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Andrew Lindesay 2020-04-19 15:44:45 +12:00 committed by waddlesplash
parent a2dbd0457f
commit a6a45d1b92

View File

@ -171,7 +171,7 @@ public:
ConvertFromParent(&parentBounds);
bounds = bounds & parentBounds;
if (bounds.Contains(where) && Window()->IsActive()) {
if (bounds.Contains(where) && Window()->IsActive() && !IsHidden()) {
BMessage message(MSG_PACKAGE_SELECTED);
message.AddString("name", PackageName());
Window()->PostMessage(&message);