fix issue that mouse_up penetration in Linux

This commit is contained in:
Jinhao 2017-02-12 08:06:50 +08:00
parent 26ec27b4c4
commit a22954d8d8

View File

@ -611,11 +611,18 @@ namespace detail
//If a root window is created during the mouse_down event, Nana.GUI will ignore the mouse_up event. //If a root window is created during the mouse_down event, Nana.GUI will ignore the mouse_up event.
if (msgwnd->root != native_interface::get_focus_window()) if (msgwnd->root != native_interface::get_focus_window())
{ {
//call the drawer mouse up event for restoring the surface graphics auto pos = native_interface::cursor_position();
msgwnd->set_action(mouse_action::normal); auto rootwd = native_interface::find_window(pos.x, pos.y);
native_interface::calc_window_point(rootwd, pos);
if(msgwnd != wd_manager.find_window(rootwd, pos.x, pos.y))
{
//call the drawer mouse up event for restoring the surface graphics
msgwnd->set_action(mouse_action::normal);
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context); arg.evt_code = event_code::mouse_up;
wd_manager.do_lazy_refresh(msgwnd, false); draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
wd_manager.do_lazy_refresh(msgwnd, false);
}
} }
} }
else else