From 9cb4c9bfc268a856f11797c63ecc0176be5d4997 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 19 Jul 2021 10:10:25 +0200 Subject: [PATCH] 3D viewer: ensure the activity messages are displayed on Linux after Frame creation. --- pcbnew/pcb_base_frame.cpp | 10 +++++++--- pcbnew/tools/pcb_viewer_tools.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 54ce8001ba..39cf892efb 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -453,9 +453,13 @@ EDA_3D_VIEWER_FRAME* PCB_BASE_FRAME::CreateAndShow3D_Frame() draw3DFrame->SetFocus(); // Allocate a slice of time to display the 3D frame - wxSafeYield(); - // And show the current board - Update3DView( true, true ); + // a call to wxSafeYield() should be enough (and better), but on Linux we need + // to call wxYield() + // otherwise the activity messages are not displayed during the first board loading + wxYield(); + + // Note, the caller is responsible to load/update the board 3D view. + // after frame creation the board is not automatically created. return draw3DFrame; } diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index eb5f9e42a4..d4e1b7bf98 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -68,11 +68,13 @@ int PCB_VIEWER_TOOLS::Show3DViewer( const TOOL_EVENT& aEvent ) || frame()->IsType( FRAME_FOOTPRINT_VIEWER_MODAL ) || frame()->IsType( FRAME_FOOTPRINT_WIZARD ) ) { - frame()->Update3DView( true, true ); - // A stronger version of Raise() which promotes the window to its parent's level. KIPLATFORM::UI::ReparentQuasiModal( draw3DFrame ); } + + // And load or update the current board + frame()->Update3DView( true, true ); + return 0; }