mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fix bug where plugins with additional top-level windows could fail to repaint after changing the display config
This commit is contained in:
parent
025a05d210
commit
19aade443a
1 changed files with 14 additions and 1 deletions
|
|
@ -3477,6 +3477,19 @@ private:
|
|||
yes
|
||||
};
|
||||
|
||||
static void updateVBlankDispatcherForAllPeers (ForceRefreshDispatcher force = ForceRefreshDispatcher::no)
|
||||
{
|
||||
// There's an edge case where only top-level windows seem to get WM_SETTINGCHANGE
|
||||
// messages, which means that if we have a plugin that opens its own top-level/desktop
|
||||
// window, then the extra window might get a SETTINGCHANGE but the plugin window may not.
|
||||
// If we only update the vblank dispatcher for windows that get a SETTINGCHANGE, we might
|
||||
// miss child windows, and those windows won't be able to repaint.
|
||||
|
||||
for (auto i = getNumPeers(); --i >= 0;)
|
||||
if (auto* peer = static_cast<HWNDComponentPeer*> (getPeer (i)))
|
||||
peer->updateCurrentMonitorAndRefreshVBlankDispatcher (force);
|
||||
}
|
||||
|
||||
void updateCurrentMonitorAndRefreshVBlankDispatcher (ForceRefreshDispatcher force = ForceRefreshDispatcher::no)
|
||||
{
|
||||
auto monitor = MonitorFromWindow (hwnd, MONITOR_DEFAULTTONULL);
|
||||
|
|
@ -3655,7 +3668,7 @@ private:
|
|||
|
||||
auto* dispatcher = VBlankDispatcher::getInstance();
|
||||
dispatcher->reconfigureDisplays();
|
||||
updateCurrentMonitorAndRefreshVBlankDispatcher (ForceRefreshDispatcher::yes);
|
||||
updateVBlankDispatcherForAllPeers (ForceRefreshDispatcher::yes);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue