From 2b22cbe94dd9a722fd40903684d4164b31a32778 Mon Sep 17 00:00:00 2001 From: Jeff Young <jeff@rokeby.ie> Date: Mon, 21 May 2018 12:23:28 +0100 Subject: [PATCH] Release mouse before closing HTML_MESSAGE_BOX. Fixes: lp:1772275 * https://bugs.launchpad.net/kicad/+bug/1772275 --- common/html_messagebox.cpp | 8 ++++++++ include/html_messagebox.h | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/html_messagebox.cpp b/common/html_messagebox.cpp index 874897f13c..d7cfdd17a6 100644 --- a/common/html_messagebox.cpp +++ b/common/html_messagebox.cpp @@ -41,6 +41,14 @@ HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle) : } +HTML_MESSAGE_BOX::~HTML_MESSAGE_BOX() +{ + // Prevent wxWidgets bug which fails to release when closing the window on an <esc>. + if( m_htmlWindow->HasCapture() ) + m_htmlWindow->ReleaseMouse(); +} + + void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event ) { // the dialog can be shown modal or not modal. diff --git a/include/html_messagebox.h b/include/html_messagebox.h index 6837c3adc4..c1ea3c2199 100644 --- a/include/html_messagebox.h +++ b/include/html_messagebox.h @@ -44,10 +44,8 @@ protected: void OnCloseButtonClick( wxCommandEvent& event ) override; public: - /** - * Constructor - */ HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle ); + ~HTML_MESSAGE_BOX() override; /** * set the dialog size, using a "logical value.