From 7a564d98db0b7c7be5b3bfac955cb88998a472ac Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 29 Mar 2022 12:24:06 +0800 Subject: ... --- src/ui/host/RoutedEventDispatch.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ui/host/RoutedEventDispatch.h') diff --git a/src/ui/host/RoutedEventDispatch.h b/src/ui/host/RoutedEventDispatch.h index 2f437b31..5d1c8ce5 100644 --- a/src/ui/host/RoutedEventDispatch.h +++ b/src/ui/host/RoutedEventDispatch.h @@ -3,10 +3,11 @@ #include "cru/common/log/Logger.h" #include "cru/ui/DebugFlags.h" #include "cru/ui/controls/Control.h" +#include "cru/ui/host/WindowHost.h" #include -namespace cru::ui { +namespace cru::ui::host { // Dispatch the event. // // This will raise routed event of the control and its parent and parent's @@ -40,6 +41,8 @@ void DispatchEvent( return; } + WindowHost::EnterEventHandling(); + std::vector> receive_list; auto parent = original_sender; @@ -119,5 +122,7 @@ void DispatchEvent( if constexpr (debug_flags::routed_event) CRU_LOG_DEBUG(u"Routed event dispatch finished."); + + WindowHost::LeaveEventHandling(); } -} // namespace cru::ui +} // namespace cru::ui::host -- cgit v1.2.3