From fbf12cb85c9117f4d101a329ed9d465c1b6739db Mon Sep 17 00:00:00 2001
From: jean-pierre charras <jp.charras@wanadoo.fr>
Date: Sun, 21 Feb 2021 16:01:36 +0100
Subject: [PATCH] microwave tools: use ShowQuasiModal instead of ShowModal to
 display WX_TEXT_ENTRY_DIALOG dlgs In some cases ShowModal does not work fine
 with our events handlers, at least on Windows. Fixes #7641
 https://gitlab.com/kicad/code/kicad/issues/7641

---
 pcbnew/microwave/microwave_footprint.cpp | 4 ++--
 pcbnew/microwave/microwave_inductor.cpp  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pcbnew/microwave/microwave_footprint.cpp b/pcbnew/microwave/microwave_footprint.cpp
index c62fe9dc4e..e257678e9f 100644
--- a/pcbnew/microwave/microwave_footprint.cpp
+++ b/pcbnew/microwave/microwave_footprint.cpp
@@ -77,7 +77,7 @@ FOOTPRINT* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprint
     wxString value = StringFromValue( editFrame.GetUserUnits(), gap_size );
     WX_TEXT_ENTRY_DIALOG dlg( &editFrame, msg, _( "Create microwave footprint" ), value );
 
-    if( dlg.ShowModal() != wxID_OK )
+    if( dlg.ShowQuasiModal() != wxID_OK )
         return NULL; // cancelled by user
 
     value    = dlg.GetValue();
@@ -92,7 +92,7 @@ FOOTPRINT* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprint
         WX_TEXT_ENTRY_DIALOG angledlg( &editFrame, _( "Angle in degrees:" ),
                                        _( "Create microwave footprint" ), msg );
 
-        if( angledlg.ShowModal() != wxID_OK )
+        if( angledlg.ShowQuasiModal() != wxID_OK )
             return NULL; // cancelled by user
 
         msg = angledlg.GetValue();
diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp
index 39def27828..770a2b805a 100644
--- a/pcbnew/microwave/microwave_inductor.cpp
+++ b/pcbnew/microwave/microwave_inductor.cpp
@@ -372,7 +372,7 @@ FOOTPRINT* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN&
     msg = StringFromValue( editFrame.GetUserUnits(), aInductorPattern.m_Length );
     WX_TEXT_ENTRY_DIALOG dlg( &editFrame, _( "Length of Trace:" ), wxEmptyString, msg );
 
-    if( dlg.ShowModal() != wxID_OK )
+    if( dlg.ShowQuasiModal() != wxID_OK )
         return nullptr; // canceled by user
 
     msg = dlg.GetValue();
@@ -410,7 +410,7 @@ FOOTPRINT* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN&
     WX_TEXT_ENTRY_DIALOG cmpdlg( &editFrame, _( "Component Value:" ), wxEmptyString, msg );
     cmpdlg.SetTextValidator( FOOTPRINT_NAME_VALIDATOR( &msg ) );
 
-    if( ( cmpdlg.ShowModal() != wxID_OK ) || msg.IsEmpty() )
+    if( ( cmpdlg.ShowQuasiModal() != wxID_OK ) || msg.IsEmpty() )
         return nullptr;    //  Aborted by user
 
     FOOTPRINT* footprint = editFrame.CreateNewFootprint( msg );