Lock the windows when we ask about unsaved changes

Fix #9274
This commit is contained in:
Marek Roszko 2021-09-29 23:00:08 -04:00
parent 13d913a014
commit 0e3b001c51
1 changed files with 8 additions and 0 deletions

View File

@ -206,6 +206,14 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
// wxRichMessageDialog.
return UnsavedChangesDialog( parent, aMessage, nullptr );
#else
#ifdef _WIN32
// wxMessageDialog on windows invokes TaskDialogIndirect which is a native function for a dialog
// As a result it skips wxWidgets for modal management...and we don't parent frames properly
// among other things for Windows to do the right thing by default
// Disable all the windows manually to avoid being able to hit this dialog from the tool frame and kicad frame at the same time
wxWindowDisabler disable( true );
#endif
wxMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );