Tearouts don't tear back in since change to JUCE 8
mkruselj opened this issue · 5 comments
Steps to reproduce:
- Open any overlay
- Tear it out
- Click the yellow _ to bring it back to the main UI
Result:
The window is just hidden, it does not reappear in the main UI. Clicking the button to open the overlay doesn't do it the first time, you need to click another time to open the overlay again, but then it opens already torn out. It never rejoined the main UI.
@baconpaul says he can't reproduce on Mac, so this might be a Windows-only shenanigan.
The problem is the new change to look at headers
for (const auto& [control, kind] : { std::tuple (getMinimiseButton(), WindowControlKind::minimise),
std::tuple (getMaximiseButton(), WindowControlKind::maximise),
std::tuple (getCloseButton(), WindowControlKind::close) })
{
if (control != nullptr && control->contains (control->getLocalPoint (this, pt)))
return kind;
}
that code around line 304 of juce_DocumentWindow.cpp means we don't get a custon minimize callback
I'll report it on the forum. And worst case I can comment out those lines in our fork.
Which then dives into line 3825 of juce_Windowing_windows.cpp
const auto localPoint = getLocalPointFromScreenLParam (lParam).toFloat();
const auto kind = component.findControlAtPoint (localPoint);
using Kind = Component::WindowControlKind;
switch (kind)
{
case Kind::caption: return HTCAPTION;
case Kind::minimise: return HTMINBUTTON;
case Kind::maximise: return HTMAXBUTTON;
case Kind::close: return HTCLOSE;
case Kind::sizeTop: return HTTOP;
case Kind::sizeLeft: return HTLEFT;
case Kind::sizeRight: return HTRIGHT;
case Kind::sizeBottom: return HTBOTTOM;
just sticking it here since this windows box is logged onto github but not the forum so i have to switch machines to write this up
Reuk reports in the above forum thread that this is fixed btw!
Yup we need to pull up to 803 and re-test