From e1a6857d5ab543702d247d1602c7708c6b4e43fb Mon Sep 17 00:00:00 2001 From: tommash Date: Wed, 15 Mar 2017 12:37:00 +0100 Subject: [PATCH] Don't send unnecessary events when wxSpinCtrlDouble loses focus Only send the event when the control loses focus if its value has really changed. See https://github.com/wxWidgets/wxWidgets/pull/436 (cherry picked from commit 5e24bd162c43dc6b02d64a158801f6bdde235923) --- src/generic/spinctlg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index e69cdde203..02e951f256 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -432,8 +432,8 @@ void wxSpinCtrlGenericBase::OnSpinButton(wxSpinEvent& event) void wxSpinCtrlGenericBase::OnTextLostFocus(wxFocusEvent& event) { - SyncSpinToText(SendEvent_Text); - DoSendEvent(); + if ( SyncSpinToText(SendEvent_Text) ) + DoSendEvent(); event.Skip(); }