From f1950d11115461735ade9d98ee01ec1aa9fa2ec9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Aug 2014 12:47:45 +0000 Subject: [PATCH] Don't activate hidden buttons when Enter is pressed in wxMSW. The keyboard handling code could decide to activate a button which wasn't currently visible at all, e.g. because it was on a non-current, and hence hidden, page of a wxBookCtrl. This didn't make any sense, so check for the button visibility before activating it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 12655d3c1a..742bd32022 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2536,7 +2536,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) } } - if ( btn && btn->IsEnabled() ) + if ( btn && btn->IsEnabled() && btn->IsShownOnScreen() ) { btn->MSWCommand(BN_CLICKED, 0 /* unused */); return true;