aboutsummaryrefslogtreecommitdiff
path: root/src/ui/helper/ClickDetector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/helper/ClickDetector.cpp')
-rw-r--r--src/ui/helper/ClickDetector.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ui/helper/ClickDetector.cpp b/src/ui/helper/ClickDetector.cpp
index be1cbca2..0ac0515f 100644
--- a/src/ui/helper/ClickDetector.cpp
+++ b/src/ui/helper/ClickDetector.cpp
@@ -3,14 +3,13 @@
#include "cru/base/log/Logger.h"
#include "cru/ui/DebugFlags.h"
#include "cru/ui/controls/Control.h"
-#include "cru/ui/controls/Window.h"
+#include "cru/ui/controls/ControlHost.h"
namespace cru::ui::helper {
Point ClickEventArgs::GetDownPointOfScreen() const {
- auto window = sender_->GetWindow();
- if (window != nullptr) {
- return down_point_ +
- window->GetNativeWindow()->GetClientRect().GetLeftTop();
+ auto host = sender_->GetControlHost();
+ if (host != nullptr) {
+ return down_point_ + host->GetNativeWindow()->GetClientRect().GetLeftTop();
} else {
return down_point_;
}