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:
@@ -2497,10 +2497,6 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||
Update();
|
||||
#endif // 0
|
||||
|
||||
menu->SetInvokingWindow(this);
|
||||
|
||||
// wxLogDebug( "Name of invoking window %s", menu->GetInvokingWindow()->GetName().c_str() );
|
||||
|
||||
menu->Popup(ClientToScreen(wxPoint(x, y)), wxSize(0,0));
|
||||
|
||||
// this is not very useful if the menu was popped up because of the mouse
|
||||
@@ -2523,8 +2519,6 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||
// remove the handler
|
||||
PopEventHandler(true /* delete it */);
|
||||
|
||||
menu->SetInvokingWindow(NULL);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
SetCursor(cursorOld);
|
||||
#endif // __WXMSW__
|
||||
|
||||
Reference in New Issue
Block a user