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

Unified Diff: components/mus/public/cpp/lib/window.cc

Issue 1991973003: mash: Preliminary support for widget hit test masks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 | « no previous file | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/window.cc
diff --git a/components/mus/public/cpp/lib/window.cc b/components/mus/public/cpp/lib/window.cc
index c5a3c310253f2b1e06adea6816d04450505a7cde..b6a329c6dc94a79f599decd35dbde497bb7ab356 100644
--- a/components/mus/public/cpp/lib/window.cc
+++ b/components/mus/public/cpp/lib/window.cc
@@ -217,6 +217,30 @@ void Window::SetClientArea(
LocalSetClientArea(client_area, additional_client_areas);
}
+void Window::SetHitTestMask(const gfx::Rect& mask) {
+ if (!OwnsWindowOrIsRoot(this))
+ return;
+
+ if (hit_test_mask_ && *hit_test_mask_ == mask)
+ return;
+
+ if (connection_)
+ tree_client()->SetHitTestMask(server_id_, mask);
+ hit_test_mask_.reset(new gfx::Rect(mask));
+}
+
+void Window::ClearHitTestMask() {
+ if (!OwnsWindowOrIsRoot(this))
+ return;
+
+ if (!hit_test_mask_)
+ return;
+
+ if (connection_)
+ tree_client()->ClearHitTestMask(server_id_);
+ hit_test_mask_.reset();
+}
+
void Window::SetVisible(bool value) {
if (visible_ == value)
return;
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_tree_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698