Fix BrushPopup bug disappearing when mouse moves to other brush type

There were an old bug where the brush popup changed its behavior after
opening a BrushSlotParams menu popup i.e. after that the BrushPopup
disappeared just leaving the mouse outside its hot region (but before
that it disappeared clicking outside the BrushPopup).

Anyway with this change the BrushPopup will disappear only clicking
outside the popup in all cases.
This commit is contained in:
David Capello 2021-05-15 13:56:34 -03:00
parent d1dcbcbad0
commit e4e8bfb246

View File

@ -58,20 +58,7 @@ void show_popup_menu(PopupWindow* popupWindow,
const gfx::Point& pt,
Display* display)
{
// Here we make the popup window temporaly floating, so it's
// not closed by the popup menu.
popupWindow->makeFloating();
popupMenu->showPopup(pt, display);
// Add the menu popup region to the window popup hot region so it's
// not closed after we close the menu.
popupWindow->makeFixed();
gfx::Region rgn;
rgn.createUnion(gfx::Region(popupWindow->boundsOnScreen()),
gfx::Region(popupMenu->boundsOnScreen()));
popupWindow->setHotRegion(rgn);
}
class SelectBrushItem : public ButtonSet::Item {