diff --git a/modules/juce_gui_basics/native/juce_Windowing_linux.cpp b/modules/juce_gui_basics/native/juce_Windowing_linux.cpp index ae7926bb02..d6d3f322da 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_linux.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_linux.cpp @@ -110,7 +110,13 @@ public: WeakReference deletionChecker (&component); - XWindowSystem::getInstance()->setBounds (windowH, physicalBounds, isNowFullScreen); + // If we are in a ConfigureNotify handler then forceSetBounds is being called as a + // consequence of X11 telling us what the window size is. There's no need to report this + // size back again to X11. By this we are avoiding a pitfall, when we get many subsequent + // ConfigureNotify events, many of which has stale size information. By not calling + // XWindowSystem::setBounds we are not actualising these old, incorrect sizes. + if (! inConfigureNotifyHandler) + XWindowSystem::getInstance()->setBounds (windowH, physicalBounds, isNowFullScreen); fullScreen = isNowFullScreen; @@ -421,6 +427,7 @@ public: //============================================================================== static bool isActiveApplication; bool focused = false; + bool inConfigureNotifyHandler = false; private: //============================================================================== diff --git a/modules/juce_gui_basics/native/juce_XWindowSystem_linux.cpp b/modules/juce_gui_basics/native/juce_XWindowSystem_linux.cpp index 57d8ae6f88..8e89116f87 100644 --- a/modules/juce_gui_basics/native/juce_XWindowSystem_linux.cpp +++ b/modules/juce_gui_basics/native/juce_XWindowSystem_linux.cpp @@ -3773,6 +3773,8 @@ void XWindowSystem::dismissBlockingModals (LinuxComponentPeer* peer) const void XWindowSystem::handleConfigureNotifyEvent (LinuxComponentPeer* peer, XConfigureEvent& confEvent) const { + const ScopedValueSetter scope { peer->inConfigureNotifyHandler, true }; + peer->updateWindowBounds(); peer->updateBorderSize(); peer->handleMovedOrResized();