1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Linux: Fix sporadic positioning error after window creation

This commit is contained in:
attila 2022-05-16 17:10:12 +02:00
parent 2ec861d99e
commit 2c2c21ebc9
2 changed files with 40 additions and 8 deletions

View file

@ -752,6 +752,16 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
peer->setConstrainer (currentConstrainer);
repaint();
#if JUCE_LINUX
// Creating the peer Image on Linux will change the reported position of the window. If
// the Image creation is interleaved with the coming configureNotifyEvents the window
// will appear in the wrong position. To avoid this, we force the Image creation here,
// before handling any of the configureNotifyEvents. The Linux implementation of
// performAnyPendingRepaintsNow() will force update the peer position if necessary.
peer->performAnyPendingRepaintsNow();
#endif
internalHierarchyChanged();
if (auto* handler = getAccessibilityHandler())