Merge branch 'hotfix-1.4' into develop
This commit is contained in:
@@ -442,8 +442,6 @@ namespace nana
|
||||
|
||||
bool basic_window::set_events(const std::shared_ptr<general_events>& p)
|
||||
{
|
||||
if (annex.events_ptr)
|
||||
return false;
|
||||
annex.events_ptr = p;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -626,30 +626,38 @@ namespace detail
|
||||
if(pressed_wd_space)
|
||||
break;
|
||||
|
||||
msgwnd = wd_manager.find_window(native_window, xevent.xbutton.x, xevent.xbutton.y);
|
||||
if(nullptr == msgwnd)
|
||||
break;
|
||||
|
||||
if(xevent.xbutton.button == Button4 || xevent.xbutton.button == Button5)
|
||||
{
|
||||
//The hovered window receives the message, unlike in Windows, no redirection is required.
|
||||
nana::point mspos{xevent.xbutton.x, xevent.xbutton.y};
|
||||
while(msgwnd)
|
||||
auto evt_wd = msgwnd;
|
||||
while(evt_wd)
|
||||
{
|
||||
if(msgwnd->annex.events_ptr->mouse_wheel.length() != 0)
|
||||
if(evt_wd->annex.events_ptr->mouse_wheel.length() != 0)
|
||||
{
|
||||
mspos -= msgwnd->pos_root;
|
||||
arg_wheel arg;
|
||||
arg.which = arg_wheel::wheel::vertical;
|
||||
assign_arg(arg, msgwnd, xevent);
|
||||
brock.emit(event_code::mouse_wheel, msgwnd, arg, true, &context);
|
||||
assign_arg(arg, evt_wd, xevent);
|
||||
brock.emit(event_code::mouse_wheel, evt_wd, arg, true, &context);
|
||||
break;
|
||||
}
|
||||
msgwnd = msgwnd->parent;
|
||||
evt_wd = evt_wd->parent;
|
||||
}
|
||||
|
||||
if(msgwnd && (nullptr == evt_wd))
|
||||
{
|
||||
arg_wheel arg;
|
||||
arg.which = arg_wheel::wheel::vertical;
|
||||
assign_arg(arg, msgwnd, xevent);
|
||||
draw_invoker(&drawer::mouse_wheel, msgwnd, arg, &context);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msgwnd = wd_manager.find_window(native_window, xevent.xbutton.x, xevent.xbutton.y);
|
||||
if(nullptr == msgwnd)
|
||||
break;
|
||||
|
||||
msgwnd->set_action(mouse_action::normal);
|
||||
if(msgwnd->flags.enabled)
|
||||
{
|
||||
|
||||
@@ -1124,8 +1124,6 @@ namespace detail
|
||||
if (evt_wd->annex.events_ptr->mouse_wheel.length() != 0)
|
||||
{
|
||||
def_window_proc = false;
|
||||
nana::point mspos{ scr_pos.x, scr_pos.y };
|
||||
wd_manager.calc_window_point(evt_wd, mspos);
|
||||
|
||||
arg_wheel arg;
|
||||
arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical);
|
||||
@@ -1138,9 +1136,6 @@ namespace detail
|
||||
|
||||
if (scrolled_wd && (nullptr == evt_wd))
|
||||
{
|
||||
nana::point mspos{ scr_pos.x, scr_pos.y };
|
||||
wd_manager.calc_window_point(scrolled_wd, mspos);
|
||||
|
||||
arg_wheel arg;
|
||||
arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical);
|
||||
assign_arg(arg, scrolled_wd, pmdec);
|
||||
|
||||
@@ -1714,6 +1714,11 @@ namespace detail
|
||||
wd->annex.caret_ptr = nullptr;
|
||||
}
|
||||
|
||||
using effect_renderer = detail::edge_nimbus_renderer<basic_window>;
|
||||
|
||||
//remove the window from edge nimbus effect when it is destroying
|
||||
effect_renderer::instance().erase(wd);
|
||||
|
||||
arg_destroy arg;
|
||||
arg.window_handle = reinterpret_cast<window>(wd);
|
||||
brock.emit(event_code::destroy, wd, arg, true, brock.get_thread_context());
|
||||
|
||||
Reference in New Issue
Block a user