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:
parent
8334cb9a1c
commit
c03535343c
|
@ -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.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
|
@ -37,7 +32,6 @@
|
||||||
#include <sch_component.h>
|
#include <sch_component.h>
|
||||||
#include <class_libentry.h>
|
#include <class_libentry.h>
|
||||||
#include <lib_field.h>
|
#include <lib_field.h>
|
||||||
#include <sch_component.h>
|
|
||||||
#include <template_fieldnames.h>
|
#include <template_fieldnames.h>
|
||||||
#include <class_library.h>
|
#include <class_library.h>
|
||||||
#include <sch_validators.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 )
|
void DIALOG_EDIT_ONE_FIELD::OnSetFocusText( wxFocusEvent& event )
|
||||||
{
|
{
|
||||||
|
#ifdef __WXGTK__
|
||||||
// Force an update of the text control before setting the text selection
|
// 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
|
// 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();
|
m_TextValue->Update();
|
||||||
|
#endif
|
||||||
|
|
||||||
if( m_fieldId == REFERENCE )
|
if( m_fieldId == REFERENCE )
|
||||||
SelectReferenceNumber( static_cast<wxTextEntry*>( m_TextValue ) );
|
SelectReferenceNumber( static_cast<wxTextEntry*>( m_TextValue ) );
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <tool/tool_manager.h>
|
|
||||||
#include <tool/picker_tool.h>
|
#include <tool/picker_tool.h>
|
||||||
#include <tools/sch_edit_tool.h>
|
#include <tools/sch_edit_tool.h>
|
||||||
#include <tools/ee_selection_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 )
|
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();
|
SCH_COMPONENT* component = (SCH_COMPONENT*) aField->GetParent();
|
||||||
|
|
||||||
// Save old component in undo list if not already in edit, or moving.
|
// Save old component in undo list if not already in edit, or moving.
|
||||||
|
|
Loading…
Reference in New Issue