From 39c3f85627571e9d3420781787a576ce8e300ac1 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Wed, 19 Jun 2019 23:42:50 +0800 Subject: [PATCH] fix bug that click event is triggered by pressing space on disabled button --- source/gui/detail/bedrock_posix.cpp | 4 ++-- source/gui/detail/bedrock_windows.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/gui/detail/bedrock_posix.cpp b/source/gui/detail/bedrock_posix.cpp index 9b1160bf..699e7380 100644 --- a/source/gui/detail/bedrock_posix.cpp +++ b/source/gui/detail/bedrock_posix.cpp @@ -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); diff --git a/source/gui/detail/bedrock_windows.cpp b/source/gui/detail/bedrock_windows.cpp index d549bedc..a84d9e61 100644 --- a/source/gui/detail/bedrock_windows.cpp +++ b/source/gui/detail/bedrock_windows.cpp @@ -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);