fix the issue of restoring focus(#37)

This commit is contained in:
Jinhao
2015-04-15 22:36:24 +08:00
parent 53c36b7363
commit f11e5efe80
3 changed files with 42 additions and 12 deletions

View File

@@ -8,7 +8,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: nana/gui/detail/window_manager.cpp
*
* @author: Jinhao
* @contributors: Katsuhisa Yuasa
*/
#include <nana/config.hpp>
@@ -875,6 +876,14 @@ namespace detail
if (!root_has_been_focused)
native_interface::set_focus(root_wd->root);
//A fix by Katsuhisa Yuasa
//The menubar token window will be redirected to the prev focus window when the new
//focus window is a menubar.
//The focus window will be restore to the prev focus which losts the focus becuase of
//memberbar.
if (wd == wd->root_widget->other.attribute.root->menubar)
wd = prev_focus;
brock.set_menubar_taken(wd);
}
return prev_focus;