Fix random node selection in symbol library editor on Windows
Selecting a node while wxDataViewCtrl is frozen selects a random node on Windows. Fixes: lp:1739202 * https://bugs.launchpad.net/kicad/+bug/1739202
This commit is contained in:
parent
457bbbed15
commit
6344e238b3
|
@ -31,7 +31,6 @@
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/statbmp.h>
|
#include <wx/statbmp.h>
|
||||||
#include <wx/html/htmlwin.h>
|
#include <wx/html/htmlwin.h>
|
||||||
#include <wx/wupdlock.h>
|
|
||||||
|
|
||||||
#include <symbol_lib_table.h>
|
#include <symbol_lib_table.h>
|
||||||
|
|
||||||
|
@ -204,11 +203,15 @@ COMPONENT_TREE::STATE COMPONENT_TREE::getState() const
|
||||||
|
|
||||||
void COMPONENT_TREE::setState( const STATE& aState )
|
void COMPONENT_TREE::setState( const STATE& aState )
|
||||||
{
|
{
|
||||||
wxWindowUpdateLocker updateLock( m_tree_ctrl );
|
m_tree_ctrl->Freeze();
|
||||||
|
|
||||||
for( const auto& item : aState.expanded )
|
for( const auto& item : aState.expanded )
|
||||||
m_tree_ctrl->Expand( item );
|
m_tree_ctrl->Expand( item );
|
||||||
|
|
||||||
|
// wxDataViewCtrl cannot be frozen when a selection
|
||||||
|
// command is issued, otherwise it selects a random item (Windows)
|
||||||
|
m_tree_ctrl->Thaw();
|
||||||
|
|
||||||
if( aState.selection.IsValid() )
|
if( aState.selection.IsValid() )
|
||||||
SelectLibId( aState.selection );
|
SelectLibId( aState.selection );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue