fix bug that click event is triggered by pressing space on disabled button

This commit is contained in:
Jinhao 2019-06-19 23:42:50 +08:00
parent e5a935ab83
commit 39c3f85627
2 changed files with 4 additions and 4 deletions

View File

@ -1019,7 +1019,7 @@ namespace detail
else if((keyboard::space == os_code) && msgwnd->flags.space_click_enabled)
{
//Clicked by spacebar
if((nullptr == pressed_wd) && (nullptr == pressed_wd_space))
if((nullptr == pressed_wd) && (nullptr == pressed_wd_space) && msgwnd->flags.enabled)
{
arg_mouse arg;
arg.alt = modifiers_status.alt;
@ -1122,7 +1122,7 @@ namespace detail
msgwnd = brock.focus();
if(msgwnd)
{
if(msgwnd == pressed_wd_space)
if((msgwnd == pressed_wd_space) && msgwnd->flags.enabled)
{
msgwnd->set_action(mouse_action::normal);

View File

@ -1386,7 +1386,7 @@ namespace detail
else if ((VK_SPACE == wParam) && msgwnd->flags.space_click_enabled)
{
//Clicked by spacebar
if (nullptr == pressed_wd && nullptr == pressed_wd_space)
if ((nullptr == pressed_wd) && (nullptr == pressed_wd_space) && msgwnd->flags.enabled)
{
arg_mouse arg;
arg.alt = false;
@ -1468,7 +1468,7 @@ namespace detail
msgwnd = brock.focus();
if (msgwnd)
{
if (msgwnd == pressed_wd_space)
if ((msgwnd == pressed_wd_space) && msgwnd->flags.enabled)
{
msgwnd->set_action(mouse_action::normal);