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

Unified Diff: ash/host/ash_window_tree_host_ozone.cc

Issue 873563002: [Ozone] Constrain the cursor when overscan insets are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | ui/aura/window_tree_host_ozone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/host/ash_window_tree_host_ozone.cc
diff --git a/ash/host/ash_window_tree_host_ozone.cc b/ash/host/ash_window_tree_host_ozone.cc
index a2e336b71038eb4fcd35f96c7454a19e324c551c..860d1ed7c321785fe8681a595497d62fd58b4511 100644
--- a/ash/host/ash_window_tree_host_ozone.cc
+++ b/ash/host/ash_window_tree_host_ozone.cc
@@ -13,6 +13,7 @@
#include "ui/gfx/transform.h"
#include "ui/ozone/public/input_controller.h"
#include "ui/ozone/public/ozone_platform.h"
+#include "ui/platform_window/platform_window.h"
namespace ash {
namespace {
@@ -37,6 +38,7 @@ class AshWindowTreeHostOzone : public AshWindowTreeHost,
gfx::Transform GetInverseRootTransform() const override;
void UpdateRootWindowSize(const gfx::Size& host_size) override;
void OnCursorVisibilityChangedNative(bool show) override;
+ void SetBounds(const gfx::Rect& bounds) override;
void DispatchEvent(ui::Event* event) override;
// Temporarily disable the tap-to-click feature. Used on CrOS.
@@ -59,7 +61,10 @@ void AshWindowTreeHostOzone::ToggleFullScreen() {
}
bool AshWindowTreeHostOzone::ConfineCursorToRootWindow() {
- return false;
+ gfx::Rect confined_bounds(GetBounds().size());
+ confined_bounds.Inset(transformer_helper_.GetHostInsets());
+ platform_window()->ConfineCursorToBounds(confined_bounds);
+ return true;
}
void AshWindowTreeHostOzone::UnConfineCursor() {
@@ -69,6 +74,7 @@ void AshWindowTreeHostOzone::UnConfineCursor() {
void AshWindowTreeHostOzone::SetRootWindowTransformer(
scoped_ptr<RootWindowTransformer> transformer) {
transformer_helper_.SetRootWindowTransformer(transformer.Pass());
+ ConfineCursorToRootWindow();
}
gfx::Insets AshWindowTreeHostOzone::GetHostInsets() const {
@@ -99,6 +105,11 @@ void AshWindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) {
SetTapToClickPaused(!show);
}
+void AshWindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) {
+ WindowTreeHostOzone::SetBounds(bounds);
+ ConfineCursorToRootWindow();
+}
+
void AshWindowTreeHostOzone::DispatchEvent(ui::Event* event) {
if (event->IsLocatedEvent())
TranslateLocatedEvent(static_cast<ui::LocatedEvent*>(event));
« no previous file with comments | « no previous file | ui/aura/window_tree_host_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698