Skip to content

Commit

Permalink
Fix assertion on startup in Regular layout
Browse files Browse the repository at this point in the history
Assertion caused by a recursive wxYield call: first in
LongRunningOperationHandler::onMessage and then in
RegularLayout::restoreStateFromPath.

The wxWidgets warn against use of wxYield presumably because it can cause
unexpected problems like this, so for now I have just removed the wxYield call
in RegularLayout without replacing it with anything. The startup behaviour
looks OK on Linux but if there are problems caused by window size, perhaps the
use of another function like ProcessPendingEvents() would be safer.
  • Loading branch information
Matthew Mott committed Dec 19, 2020
1 parent fbcee94 commit 6e99daf
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions radiant/ui/mainframe/RegularLayout.cpp
Expand Up @@ -135,18 +135,17 @@ void RegularLayout::restoreStateFromPath(const std::string& path)
{
// Trigger a proper resize event before setting the sash position
GlobalMainFrame().getWxTopLevelWindow()->SendSizeEvent();
wxTheApp->Yield();

// Now load the paned positions from the registry
if (GlobalRegistry().keyExists(path + "/pane[@name='horizontal']"))
{
_regular.posHPane.loadFromPath(path + "/pane[@name='horizontal']");
}
// Now load the paned positions from the registry
if (GlobalRegistry().keyExists(path + "/pane[@name='horizontal']"))
{
_regular.posHPane.loadFromPath(path + "/pane[@name='horizontal']");
}

if (GlobalRegistry().keyExists(path + "/pane[@name='texcam']"))
{
_regular.posTexCamPane.loadFromPath(path + "/pane[@name='texcam']");
}
if (GlobalRegistry().keyExists(path + "/pane[@name='texcam']"))
{
_regular.posTexCamPane.loadFromPath(path + "/pane[@name='texcam']");
}
}

void RegularLayout::restoreStateFromRegistry()
Expand Down

0 comments on commit 6e99daf

Please sign in to comment.