aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cru_event.hpp7
-rw-r--r--src/ui/window.cpp13
2 files changed, 5 insertions, 15 deletions
diff --git a/src/cru_event.hpp b/src/cru_event.hpp
index 63de7e76..fa41d646 100644
--- a/src/cru_event.hpp
+++ b/src/cru_event.hpp
@@ -76,13 +76,6 @@ namespace cru {
(handler.second)(args);
}
-
- //TODO: Remove this!
- bool IsNoHandler() const
- {
- return handlers_.empty();
- }
-
private:
std::map<EventHandlerToken, EventHandler> handlers_;
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index c757c4e1..ac79392b 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -322,15 +322,12 @@ namespace cru::ui
bool Window::HandleWindowMessage(HWND hwnd, int msg, WPARAM w_param, LPARAM l_param, LRESULT & result) {
- if (!native_message_event.IsNoHandler())
+ events::WindowNativeMessageEventArgs args(this, this, {hwnd, msg, w_param, l_param});
+ native_message_event.Raise(args);
+ if (args.GetResult().has_value())
{
- events::WindowNativeMessageEventArgs args(this, this, {hwnd, msg, w_param, l_param});
- native_message_event.Raise(args);
- if (args.GetResult().has_value())
- {
- result = args.GetResult().value();
- return true;
- }
+ result = args.GetResult().value();
+ return true;
}
switch (msg) {