Update wxHtmlWindow on DPI change

This is not ideal, as resetting the page contents loses the current
selection and redoes a lot of work that could be avoided, but it's
(much) better than nothing, as it fixes the window appearance after e.g.
moving it to another monitor.

Closes #18564.
This commit is contained in:
Maarten Bent
2020-11-28 16:56:10 +01:00
committed by Vadim Zeitlin
parent 39ca664053
commit bdc18f68b6
2 changed files with 6 additions and 0 deletions

View File

@@ -1319,6 +1319,10 @@ void wxHtmlWindow::OnSize(wxSizeEvent& event)
Refresh();
}
void wxHtmlWindow::OnDPIChanged(wxDPIChangedEvent& WXUNUSED(event))
{
DoSetPage(*(m_Parser->GetSource()));
}
void wxHtmlWindow::OnMouseMove(wxMouseEvent& WXUNUSED(event))
{
@@ -1761,6 +1765,7 @@ wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxHtmlWindow, wxScrolledWindow, "wx/html/htmlwin.h
wxBEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
EVT_SIZE(wxHtmlWindow::OnSize)
EVT_DPI_CHANGED(wxHtmlWindow::OnDPIChanged)
EVT_LEFT_DOWN(wxHtmlWindow::OnMouseDown)
EVT_LEFT_UP(wxHtmlWindow::OnMouseUp)
EVT_RIGHT_UP(wxHtmlWindow::OnMouseUp)