Hide wxSTC popup when the DPI changes

After a DPI change, the position of the popup is wrong. It is not shown at the
cursor position anymore.
The correct size and position are calculated by scintilla, and there is no easy
way to access this without modifying scintilla sources.
This commit is contained in:
Maarten Bent
2020-06-01 15:56:30 +02:00
parent 54e0521fd7
commit 5fa8280fd8
2 changed files with 14 additions and 0 deletions

View File

@@ -5446,6 +5446,13 @@ void wxStyledTextCtrl::OnDPIChanged(wxDPIChangedEvent& evt) {
{
SetMarginWidth(i, (int)wxMulDivInt32(GetMarginWidth(i), evt.GetNewDPI().y, evt.GetOldDPI().y));
}
// Hide auto-complete popup, there is no (easy) way to set it to the correct size
// and position
if ( AutoCompActive() )
{
AutoCompCancel();
}
}

View File

@@ -973,6 +973,13 @@ void wxStyledTextCtrl::OnDPIChanged(wxDPIChangedEvent& evt) {
{
SetMarginWidth(i, (int)wxMulDivInt32(GetMarginWidth(i), evt.GetNewDPI().y, evt.GetOldDPI().y));
}
// Hide auto-complete popup, there is no (easy) way to set it to the correct size
// and position
if ( AutoCompActive() )
{
AutoCompCancel();
}
}