Skip to content

Commit

Permalink
Fix showing autofix alert in some situations on macOS
Browse files Browse the repository at this point in the history
In some specific situations, primarily when opening a file while Poedit
was already running, the FixDuplicatesIfPresent() would either not show
up at all or be assigned to the wrong window, because window-modal error
dialog was created with a not-yet-visible parent.

This was a regression introduced in 0ab1044.
  • Loading branch information
vslavik committed Jan 26, 2024
1 parent 2c1e41c commit a98484b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/edframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ bool g_focusToText = false;
return nullptr;

f = new PoeditFrame();
f->Show(true);
f->ReadCatalog(cat);
}

Expand Down Expand Up @@ -2365,6 +2366,8 @@ void PoeditFrame::ReadCatalog(const CatalogPtr& cat)

void PoeditFrame::FixDuplicatesIfPresent()
{
wxASSERT_MSG( IsShown(), "this method may show UI error, which requires the window to be visible" );

auto cat = std::dynamic_pointer_cast<POCatalog>(m_catalog);
if (!cat)
return;
Expand Down

0 comments on commit a98484b

Please sign in to comment.