From 7ded318bef0a588317b97ff741695c2a4ffb18ee Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 14 Mar 2002 22:03:43 +0000 Subject: [PATCH] Added Layout() call to top level window Show() to prevent double-sizing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14594 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/app.cpp | 1 + src/x11/evtloop.cpp | 2 +- src/x11/toplevel.cpp | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/x11/app.cpp b/src/x11/app.cpp index a35a1e0546..87b09f85cc 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -648,6 +648,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) { // Only erase background, paint in idle time. win->SendEraseEvents(); + //win->Update(); } return TRUE; diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index ebe1ebb13a..483c4683f0 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -170,7 +170,7 @@ int wxEventLoop::Run() #endif if (!m_impl->SendIdleEvent()) { -#if 0 // wxUSE_THREADS +#if wxUSE_THREADS // leave the main loop to give other threads a chance to // perform their GUI work wxMutexGuiLeave(); diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 2fef702902..53c97f4033 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -260,6 +260,18 @@ bool wxTopLevelWindowX11::Show(bool show) m_needResizeInIdle = FALSE; } + if (show) + { + // This does the layout _before_ the + // window is shown, else the items are + // drawn first at the wrong positions, + // then at the correct positions. + if (GetAutoLayout()) + { + Layout(); + } + } + return wxWindowX11::Show(show); } -- 2.45.2