Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: components/mus/ws/window_tree_host_impl.cc

Issue 1677513002: mus Window Server: implement event capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/window_tree_host_impl.h ('k') | components/mus/ws/window_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree_host_impl.cc
diff --git a/components/mus/ws/window_tree_host_impl.cc b/components/mus/ws/window_tree_host_impl.cc
index d75b184a806be277716d0b7fc5c9ce2d45450b3b..d80ef839124b6c55642e4bcaa059f65bf5836e08 100644
--- a/components/mus/ws/window_tree_host_impl.cc
+++ b/components/mus/ws/window_tree_host_impl.cc
@@ -161,6 +161,14 @@ const mojom::ViewportMetrics& WindowTreeHostImpl::GetViewportMetrics() const {
return display_manager_->GetViewportMetrics();
}
+void WindowTreeHostImpl::SetCapture(ServerWindow* window,
+ bool in_nonclient_area) {
+ ServerWindow* capture_window = event_dispatcher_.capture_window();
+ if (capture_window == window)
+ return;
+ event_dispatcher_.SetCaptureWindow(window, in_nonclient_area);
+}
+
mojom::Rotation WindowTreeHostImpl::GetRotation() const {
return display_manager_->GetRotation();
}
@@ -343,6 +351,10 @@ void WindowTreeHostImpl::OnEvent(const ui::Event& event) {
event_dispatcher_.ProcessEvent(std::move(mojo_event));
}
+void WindowTreeHostImpl::OnNativeCaptureLost() {
+ SetCapture(nullptr, false);
+}
+
void WindowTreeHostImpl::OnDisplayClosed() {
if (delegate_)
delegate_->OnDisplayClosed();
@@ -474,6 +486,19 @@ ServerWindow* WindowTreeHostImpl::GetFocusedWindowForEventDispatcher() {
return GetFocusedWindow();
}
+void WindowTreeHostImpl::SetNativeCapture() {
+ display_manager_->SetCapture();
+}
+
+void WindowTreeHostImpl::ReleaseNativeCapture() {
+ display_manager_->ReleaseCapture();
+}
+
+void WindowTreeHostImpl::OnServerWindowCaptureLost(ServerWindow* window) {
+ DCHECK(window);
+ connection_manager_->ProcessLostCapture(window);
+}
+
void WindowTreeHostImpl::DispatchInputEventToWindow(ServerWindow* target,
bool in_nonclient_area,
mojom::EventPtr event) {
« no previous file with comments | « components/mus/ws/window_tree_host_impl.h ('k') | components/mus/ws/window_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698