From e5a935ab8372ac6f44d04b908e69e3b8613514dd Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 18 Jun 2019 08:23:54 +0800 Subject: [PATCH 1/2] fix bug that filebox single selection fails on Linux --- source/gui/filebox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index b748b5cf..06dfed84 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -1062,6 +1062,8 @@ namespace nana { if(text.length() == start_pos) return files; + else if(0 == start_pos) //single selection + return {text}; return {}; } From 39c3f85627571e9d3420781787a576ce8e300ac1 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Wed, 19 Jun 2019 23:42:50 +0800 Subject: [PATCH 2/2] 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);