From 68ada9e169fb3dcfd1ba4d918e829e07cd7e0aff Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 22 May 2014 17:59:36 +0200 Subject: [PATCH] Fix for context menu hanging up in GAL. --- common/tool/tool_manager.cpp | 6 +----- include/tool/context_menu.h | 2 +- pcbnew/tools/selection_tool.cpp | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index a0bba9c51f..605f8505b3 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -493,7 +493,7 @@ bool TOOL_MANAGER::ProcessEvent( TOOL_EVENT& aEvent ) // If nothing was chosen from the context menu, we must notify the tool as well if( menu->GetSelected() < 0 ) { - TOOL_EVENT evt( TC_COMMAND, TA_CONTEXT_MENU_CHOICE ); + TOOL_EVENT evt( TC_COMMAND, TA_CONTEXT_MENU_CHOICE, -1 ); dispatchInternal( evt ); } @@ -518,10 +518,6 @@ void TOOL_MANAGER::ScheduleContextMenu( TOOL_BASE* aTool, CONTEXT_MENU* aMenu, st->contextMenu = aMenu; st->contextMenuTrigger = aTrigger; - - // the tool wants the menu immediately? Preempt it and do so :) - if( aTrigger == CMENU_NOW ) - st->cofunc->Yield(); } diff --git a/include/tool/context_menu.h b/include/tool/context_menu.h index 709e0d34e7..9090702f8c 100644 --- a/include/tool/context_menu.h +++ b/include/tool/context_menu.h @@ -97,7 +97,7 @@ protected: m_customHandler = aHandler; } - virtual OPT_TOOL_EVENT handleCustomEvent(const wxEvent& aEvent ) + virtual OPT_TOOL_EVENT handleCustomEvent( const wxEvent& aEvent ) { return OPT_TOOL_EVENT(); } diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 1917076f59..48d1b36412 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -451,12 +451,10 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) { brightBox.reset( new BRIGHT_BOX( current ) ); getView()->Add( brightBox.get() ); + // BRIGHT_BOX is removed from view on destruction } } - // Removes possible brighten mark - getView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY ); - return current; }