Ensure that top level window is active when it's shown in wxQt
Under some (not totally clear) circumstances, a TLW can remain inactive after being shown, which is undesirable, as it prevents setting focus to its children from working. Work around this by calling activateWindow() explicitly if necessary. Closes https://github.com/wxWidgets/wxWidgets/pull/1179
This commit is contained in:
parent
aa22547b28
commit
ae94f4da9c
@ -29,6 +29,7 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual bool Show(bool show = true) wxOVERRIDE;
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual void Restore();
|
||||
virtual void Iconize(bool iconize = true);
|
||||
|
@ -62,6 +62,17 @@ bool wxTopLevelWindowQt::Create( wxWindow *parent, wxWindowID winId,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowQt::Show(bool show)
|
||||
{
|
||||
if ( !wxTopLevelWindowBase::Show(show) )
|
||||
return false;
|
||||
|
||||
if ( show && !m_qtWindow->isActiveWindow() )
|
||||
m_qtWindow->activateWindow();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTopLevelWindowQt::Maximize(bool maximize)
|
||||
{
|
||||
QWidget *widget = GetHandle();
|
||||
|
Loading…
Reference in New Issue
Block a user