From 5e24bd162c43dc6b02d64a158801f6bdde235923 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. Closes https://github.com/wxWidgets/wxWidgets/pull/436 --- 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 a5c87a93b7..feef3a6c5f 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -410,8 +410,8 @@ void wxSpinCtrlGenericBase::OnSpinButton(wxSpinEvent& event) void wxSpinCtrlGenericBase::OnTextLostFocus(wxFocusEvent& event) { - SyncSpinToText(SendEvent_Text); - DoSendEvent(); + if ( SyncSpinToText(SendEvent_Text) ) + DoSendEvent(); event.Skip(); }