Once more into the depths of hell... er, I mean fix a focus issue.

So the new steals-focus protection stuff works well when there's a
focused control, but not as well when there's a modal dialog up which
happens not to have a focused control (or worse, a focusable control).

This adds a second mechanism for also checking to see if a modal dialog
is up (something that wxWidgets, true to form, makes very difficult).

Fixes https://gitlab.com/kicad/code/kicad/issues/6520
This commit is contained in:
Jeff Young
2020-11-26 16:47:40 +00:00
parent 2a87980d45
commit fc2bdc49de
11 changed files with 65 additions and 20 deletions
+8 -1
View File
@@ -23,7 +23,8 @@
#include <widgets/ui_common.h>
#include <algorithm>
#include <gal/color4d.h>
#include <dialog_shim.h>
#include <pgm_base.h>
int KIUI::GetStdMargin()
{
@@ -142,4 +143,10 @@ bool KIUI::IsInputControlFocused()
wxDataViewCtrl* dataViewCtrl = dynamic_cast<wxDataViewCtrl*>( focus );
return ( textEntry || styledText || listBox || dataViewCtrl );
}
bool KIUI::IsModalDialogFocused()
{
return Pgm().m_ModalDialogCount > 0;
}