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

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

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
Index: components/mus/ws/window_tree_host_impl.h
diff --git a/components/mus/ws/window_tree_host_impl.h b/components/mus/ws/window_tree_host_impl.h
index e4e2bc21062d6456c4ac25dfffb33db5d9af2e5d..a02c8664f3e7e4615d11e35e43b1107ef656f407 100644
--- a/components/mus/ws/window_tree_host_impl.h
+++ b/components/mus/ws/window_tree_host_impl.h
@@ -95,6 +95,8 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
ServerWindow* root_window() { return root_.get(); }
const ServerWindow* root_window() const { return root_.get(); }
+ void SetCapture(ServerWindow* window, bool in_nonclient_area);
+
void SetFocusedWindow(ServerWindow* window);
ServerWindow* GetFocusedWindow();
void DestroyFocusController();
@@ -107,6 +109,14 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
const ui::TextInputState& state);
void SetImeVisibility(ServerWindow* window, bool visible);
+ // Returns the window that has captured input.
+ ServerWindow* GetCaptureWindow() {
+ return event_dispatcher_.capture_window();
+ }
+ const ServerWindow* GetCaptureWindow() const {
+ return event_dispatcher_.capture_window();
+ }
+
// Called just before |tree| is destroyed after its connection encounters an
// error.
void OnWindowTreeConnectionError(WindowTreeImpl* tree);
@@ -167,6 +177,7 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
// DisplayManagerDelegate:
ServerWindow* GetRootWindow() override;
void OnEvent(const ui::Event& event) override;
+ void OnLostCapture() override;
void OnDisplayClosed() override;
void OnViewportMetricsChanged(
const mojom::ViewportMetrics& old_metrics,
@@ -188,6 +199,9 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
ServerWindow* GetFocusedWindowForEventDispatcher() override;
+ void SetCapture(ServerWindow* window) override;
+ void ReleaseCapture(ServerWindow* window) override;
+ void OnLostCapture(ServerWindow* window) override;
void DispatchInputEventToWindow(ServerWindow* target,
bool in_nonclient_area,
mojom::EventPtr event) override;

Powered by Google App Engine
This is Rietveld 408576698