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

Unified Diff: components/exo/surface.cc

Issue 2896943002: Add "stylus-tools" Wayland protocol. (Closed)
Patch Set: Moved the property out of aura Created 3 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 | « components/exo/surface.h ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index d68aa04186364f6113f8e13ed4730a3f94e5829c..6f57cf5f1cf789c48a2d3559e8895ecc9502e81a 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -26,6 +26,7 @@
#include "components/exo/surface_delegate.h"
#include "components/exo/surface_observer.h"
#include "third_party/khronos/GLES2/gl2.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/window_delegate.h"
#include "ui/aura/window_targeter.h"
@@ -52,6 +53,10 @@ namespace {
// window. If unset, no surface is associated with window.
DEFINE_UI_CLASS_PROPERTY_KEY(Surface*, kSurfaceKey, nullptr);
+// A property key to store whether the surface should only consume
+// stylus input events.
+DEFINE_UI_CLASS_PROPERTY_KEY(bool, kStylusOnlyKey, false);
+
// Helper function that returns an iterator to the first entry in |list|
// with |key|.
template <typename T, typename U>
@@ -634,6 +639,14 @@ void Surface::CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces() {
SetSurfaceHierarchyNeedsCommitToNewSurfaces();
}
+bool Surface::IsStylusOnly() {
+ return window_->GetProperty(kStylusOnlyKey);
+}
+
+void Surface::SetStylusOnly() {
+ window_->SetProperty(kStylusOnlyKey, true);
+}
+
////////////////////////////////////////////////////////////////////////////////
// ui::ContextFactoryObserver overrides:
« no previous file with comments | « components/exo/surface.h ('k') | components/exo/wayland/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698