From 7d380576ec4a86938d3d2021657bb8d6eba98c1a Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 9 Nov 2020 20:10:56 +0800 Subject: ... --- src/ui/host/WindowHost.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/host') 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 -- cgit v1.2.3