Commit 52bd6689 authored by Nicholas Hollingum's avatar Nicholas Hollingum Committed by Commit Bot

exo: Increase logging around pointer lock

In order to assist debugging efforts, we add several logging statements
which identify the cause of lost pointer locks.

Bug: b/162549144
Change-Id: Ib4cd283a864354aad9303ec23d355b2e25134201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336623
Commit-Queue: Nic Hollingum <hollingum@google.com>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795229}
parent b12c9b56
...@@ -125,6 +125,7 @@ Pointer::~Pointer() { ...@@ -125,6 +125,7 @@ Pointer::~Pointer() {
if (pointer_constraint_delegate_) { if (pointer_constraint_delegate_) {
pointer_constraint_delegate_->GetConstrainedSurface() pointer_constraint_delegate_->GetConstrainedSurface()
->RemoveSurfaceObserver(this); ->RemoveSurfaceObserver(this);
VLOG(1) << "Pointer constraint broken by pointer destruction";
pointer_constraint_delegate_->OnConstraintBroken(); pointer_constraint_delegate_->OnConstraintBroken();
} }
WMHelper* helper = WMHelper::GetInstance(); WMHelper* helper = WMHelper::GetInstance();
...@@ -252,8 +253,10 @@ void Pointer::UnconstrainPointer() { ...@@ -252,8 +253,10 @@ void Pointer::UnconstrainPointer() {
} }
bool Pointer::EnablePointerCapture(Surface* capture_surface) { bool Pointer::EnablePointerCapture(Surface* capture_surface) {
if (!base::FeatureList::IsEnabled(kPointerCapture)) if (!base::FeatureList::IsEnabled(kPointerCapture)) {
LOG(WARNING) << "Unable to capture the pointer, feature is disabled.";
return false; return false;
}
if (capture_surface->window() != if (capture_surface->window() !=
WMHelper::GetInstance()->GetFocusedWindow()) { WMHelper::GetInstance()->GetFocusedWindow()) {
...@@ -317,6 +320,7 @@ void Pointer::OnSurfaceDestroying(Surface* surface) { ...@@ -317,6 +320,7 @@ void Pointer::OnSurfaceDestroying(Surface* surface) {
if (surface && pointer_constraint_delegate_ && if (surface && pointer_constraint_delegate_ &&
surface == pointer_constraint_delegate_->GetConstrainedSurface()) { surface == pointer_constraint_delegate_->GetConstrainedSurface()) {
surface->RemoveSurfaceObserver(this); surface->RemoveSurfaceObserver(this);
VLOG(1) << "Pointer constraint broken by surface destruction";
pointer_constraint_delegate_->OnConstraintBroken(); pointer_constraint_delegate_->OnConstraintBroken();
UnconstrainPointer(); UnconstrainPointer();
} }
...@@ -544,6 +548,7 @@ void Pointer::OnWindowFocused(aura::Window* gained_focus, ...@@ -544,6 +548,7 @@ void Pointer::OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) { aura::Window* lost_focus) {
if (capture_window_ && capture_window_ != gained_focus) { if (capture_window_ && capture_window_ != gained_focus) {
if (pointer_constraint_delegate_) { if (pointer_constraint_delegate_) {
VLOG(1) << "Pointer constraint broken by focus change";
pointer_constraint_delegate_->OnConstraintBroken(); pointer_constraint_delegate_->OnConstraintBroken();
UnconstrainPointer(); UnconstrainPointer();
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment