fix an issue that menu is closed unexpected if form is modal
This commit is contained in:
parent
1b01493e9f
commit
d43c2fabc6
@ -392,8 +392,7 @@ namespace detail
|
|||||||
while (::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
while (::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
||||||
{
|
{
|
||||||
if (msg.message == WM_QUIT) break;
|
if (msg.message == WM_QUIT) break;
|
||||||
|
if ((WM_KEYFIRST <= msg.message && msg.message <= WM_KEYLAST) || !::IsDialogMessage(native_handle, &msg))
|
||||||
if ((msg.message == WM_CHAR || msg.message == WM_KEYDOWN || msg.message == WM_KEYUP) || !::IsDialogMessage(native_handle, &msg))
|
|
||||||
{
|
{
|
||||||
auto menu_wd = get_menu(reinterpret_cast<native_window_type>(msg.hwnd), true);
|
auto menu_wd = get_menu(reinterpret_cast<native_window_type>(msg.hwnd), true);
|
||||||
if (menu_wd) interior_helper_for_menu(msg, menu_wd);
|
if (menu_wd) interior_helper_for_menu(msg, menu_wd);
|
||||||
@ -1359,6 +1358,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
//Don't call default window proc to avoid popuping system menu.
|
//Don't call default window proc to avoid popuping system menu.
|
||||||
def_window_proc = false;
|
def_window_proc = false;
|
||||||
|
|
||||||
bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus);
|
bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus);
|
||||||
if (set_focus)
|
if (set_focus)
|
||||||
brock.wd_manager.set_focus(msgwnd, false);
|
brock.wd_manager.set_focus(msgwnd, false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user