aboutsummaryrefslogtreecommitdiff
path: root/src/ui/host/RoutedEventDispatch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/host/RoutedEventDispatch.h')
-rw-r--r--src/ui/host/RoutedEventDispatch.h9
1 files changed, 7 insertions, 2 deletions
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 <vector>
-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<ObjectResolver<controls::Control>> 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