Set popup menu invoking window in wxWindowBase and not in all ports.
Don't duplicate the code for setting (and unsetting, which was forgotten by at least wxGTK) the popup menu invoking window in all ports but do it in the base class PopupMenu() itself. Also add a helper wxMenuInvokingWindowSetter class which ensures that the invoking window will be unset in any case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64143 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3996,10 +3996,6 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
|
||||
|
||||
wxCHECK_MSG( menu != NULL, false, wxT("invalid popup-menu") );
|
||||
|
||||
menu->SetInvokingWindow( this );
|
||||
|
||||
menu->UpdateUI();
|
||||
|
||||
wxPoint pos;
|
||||
@@ -4034,8 +4030,6 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
|
||||
gtk_main_iteration();
|
||||
}
|
||||
|
||||
menu->SetInvokingWindow( NULL );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user