mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Linux: Prevent stale ConfigureNotify events from overwriting the current window position
This commit is contained in:
parent
efb0daf2e9
commit
3118ee1e5c
2 changed files with 10 additions and 1 deletions
|
|
@ -110,7 +110,13 @@ public:
|
|||
|
||||
WeakReference<Component> 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:
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -3773,6 +3773,8 @@ void XWindowSystem::dismissBlockingModals (LinuxComponentPeer* peer) const
|
|||
|
||||
void XWindowSystem::handleConfigureNotifyEvent (LinuxComponentPeer* peer, XConfigureEvent& confEvent) const
|
||||
{
|
||||
const ScopedValueSetter<bool> scope { peer->inConfigureNotifyHandler, true };
|
||||
|
||||
peer->updateWindowBounds();
|
||||
peer->updateBorderSize();
|
||||
peer->handleMovedOrResized();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue