From a904aa592fd566cc474c72b920765cd77c353d8b Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 4 Jun 2024 13:29:57 +0100 Subject: [PATCH] DocumentWindow: Allow custom titlebar controls to respond to mouse Prior to this change, the 'options' button in the StandaloneFilterWindow border did not respond to mouse clicks on Windows. --- modules/juce_gui_basics/windows/juce_DocumentWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp b/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp index a3ac6a0d74..43886ad981 100644 --- a/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp @@ -325,6 +325,10 @@ auto DocumentWindow::findControlAtPoint (Point pt) const -> WindowControl return WindowControlKind::sizeTop; } + for (const auto& c : getChildren()) + if (c->contains (c->getLocalPoint (this, pt))) + return WindowControlKind::client; + return WindowControlKind::caption; }