From bd99a301469fcc9856085c953526d0fab331e33a Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 16 Dec 2015 10:02:52 -0300 Subject: [PATCH] Avoid closing BrushPopup when we click the menu popup option --- src/app/ui/brush_popup.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/ui/brush_popup.cpp b/src/app/ui/brush_popup.cpp index a333d8d2d..bcd2fa2a6 100644 --- a/src/app/ui/brush_popup.cpp +++ b/src/app/ui/brush_popup.cpp @@ -138,9 +138,17 @@ private: // Here we make the popup window temporaly floating, so it's // not closed by the popup menu. m_popup->makeFloating(); + menu.showPopup(gfx::Point(origin().x, origin().y+bounds().h)); + + // Add the menu popup region to the hot region so the BrushPopup (m_popup) + // isn't closed after we click the menu popup. m_popup->makeFixed(); - m_popup->closeWindow(nullptr); + + gfx::Region rgn; + rgn.createUnion(gfx::Region(m_popup->bounds()), + gfx::Region(menu.bounds())); + m_popup->setHotRegion(rgn); } private: