diff --git a/interface/wx/popupwin.h b/interface/wx/popupwin.h index fb1030b171..01af6cfa63 100644 --- a/interface/wx/popupwin.h +++ b/interface/wx/popupwin.h @@ -84,10 +84,10 @@ public: /** Popup the window (this will show it too). - If @a winFocus is non-@NULL, it will be kept focused while this window - is shown, otherwise this window itself will receive focus. In any case, - the popup will disappear automatically if it loses focus because of a - user action. + If @a focus is non-@NULL, it will be kept focused while this window + is shown if supported by the current platform, otherwise the popup + itself will receive focus. In any case, the popup will disappear + automatically if it loses focus because of a user action. @see Dismiss() */ diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index eea9c444bc..406733d73d 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -96,7 +96,10 @@ void wxPopupTransientWindow::Popup(wxWindow* focus) { Show(); - if ( focus ) + // We can only set focus to one of our children as setting it to another + // window would result in an immediate loss of activation and popup + // disappearance. + if ( focus && IsDescendant(focus) ) focus->SetFocus(); }