Don't apply GTK fix to OSX: it produces somewhat random crashes.

Fixes: lp:1837225
* https://bugs.launchpad.net/kicad/+bug/1837225
This commit is contained in:
Jeff Young 2019-07-28 11:28:01 -06:00
parent 8334cb9a1c
commit c03535343c
2 changed files with 6 additions and 35 deletions

View File

@ -1,8 +1,3 @@
/**
* @file dialog_edit_one_field.cpp
* @brief dialog to editing a field ( not a graphic text) in current component.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
@ -37,7 +32,6 @@
#include <sch_component.h>
#include <class_libentry.h>
#include <lib_field.h>
#include <sch_component.h>
#include <template_fieldnames.h>
#include <class_library.h>
#include <sch_validators.h>
@ -122,10 +116,15 @@ void DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick( wxCommandEvent& aEvent
void DIALOG_EDIT_ONE_FIELD::OnSetFocusText( wxFocusEvent& event )
{
#ifdef __WXGTK__
// Force an update of the text control before setting the text selection
// This is needed because GTK seems to ignore the selection on first update
//
// Note that we can't do this on OSX as it tends to provoke Apple's
// "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
// bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
m_TextValue->Update();
#endif
if( m_fieldId == REFERENCE )
SelectReferenceNumber( static_cast<wxTextEntry*>( m_TextValue ) );

View File

@ -21,7 +21,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <tool/tool_manager.h>
#include <tool/picker_tool.h>
#include <tools/sch_edit_tool.h>
#include <tools/ee_selection_tool.h>
@ -1016,33 +1015,6 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
void SCH_EDIT_TOOL::editComponentFieldText( SCH_FIELD* aField )
{
#ifdef __WXMAC__
// This dialog, like no other that we currently know of, sometimes provokes Apple's
// "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
// bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
//
// Note: this bug occurs irrespecitve of whether the dialog is a modal or quasi-modal.
static bool g_initialized = false;
static bool g_idleSeen = false;
if( !g_initialized )
{
g_initialized = true;
m_frame->Bind( wxEVT_IDLE, [&] ( wxIdleEvent& aEvent ) { g_idleSeen = true; } );
}
g_idleSeen = false;
while (!g_idleSeen )
wxSafeYield();
// The above should work around the bug, but it doesn't. Doing it again cures many
// instances, but not all of them.
g_idleSeen = false;
while (!g_idleSeen )
wxSafeYield();
#endif
SCH_COMPONENT* component = (SCH_COMPONENT*) aField->GetParent();
// Save old component in undo list if not already in edit, or moving.