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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user