aboutsummaryrefslogtreecommitdiff
path: root/src/ui/host/WindowHost.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/host/WindowHost.cpp')
-rw-r--r--src/ui/host/WindowHost.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui/host/WindowHost.cpp b/src/ui/host/WindowHost.cpp
index 4bd981c2..1550361b 100644
--- a/src/ui/host/WindowHost.cpp
+++ b/src/ui/host/WindowHost.cpp
@@ -223,10 +223,12 @@ void WindowHost::SetFocusControl(controls::Control* control) {
bool WindowHost::CaptureMouseFor(controls::Control* control) {
if (!native_window_) return false;
+ if (!native_window_->CaptureMouse()) return false;
if (control == mouse_captured_control_) return true;
if (control == nullptr) {
+ native_window_->ReleaseMouse();
const auto old_capture_control = mouse_captured_control_;
mouse_captured_control_ =
nullptr; // update this in case this is used in event handlers