Commit 0e4be853 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Commit Bot

Exclude ARC windows from kExoPointerCapture flag

After certain UX concerns regarding exiting pointer capture have been
addressed, the pointer-lock protocol can be enabled for ARC windows.
This change makes it so that the kExoPointerCapture flag no longer
affects ARC windows and only affect Crostini windows.

See go/exo-pointer-lock for more information.

Bug: b/114112168
Test: manual testing using ArcPointerCaptureTestApp
Change-Id: I2f54e587c40bccbbf38e630dbfaff0896c321771
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992188
Commit-Queue: Prabir Pradhan <prabirmsp@chromium.org>
Auto-Submit: Prabir Pradhan <prabirmsp@chromium.org>
Reviewed-by: default avatarNic Hollingum <hollingum@google.com>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732230}
parent eb21998c
...@@ -126,7 +126,7 @@ const base::Feature kEnableFileManagerFeedbackPanel{ ...@@ -126,7 +126,7 @@ const base::Feature kEnableFileManagerFeedbackPanel{
const base::Feature kEolWarningNotifications{"EolWarningNotifications", const base::Feature kEolWarningNotifications{"EolWarningNotifications",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enable or disable pointer lock for exo windows. // Enable or disable pointer lock for Crostini windows.
const base::Feature kExoPointerLock{"ExoPointerLock", const base::Feature kExoPointerLock{"ExoPointerLock",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/wm/window_util.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
#endif #endif
...@@ -285,9 +286,15 @@ bool Pointer::ConstrainPointer(PointerConstraintDelegate* delegate) { ...@@ -285,9 +286,15 @@ bool Pointer::ConstrainPointer(PointerConstraintDelegate* delegate) {
// namespace only exists in chromeos builds). So we do not compile pointer // namespace only exists in chromeos builds). So we do not compile pointer
// lock support unless we are on chromeos. // lock support unless we are on chromeos.
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
if (!base::FeatureList::IsEnabled(chromeos::features::kExoPointerLock)) Surface* constrained_surface = delegate->GetConstrainedSurface();
// Pointer lock should be enabled for ARC by default. The kExoPointerLock
// should only apply to Crostini windows.
bool is_arc_window = ash::window_util::IsArcWindow(
constrained_surface->window()->GetToplevelWindow());
if (!is_arc_window &&
!base::FeatureList::IsEnabled(chromeos::features::kExoPointerLock))
return false; return false;
bool success = EnablePointerCapture(delegate->GetConstrainedSurface()); bool success = EnablePointerCapture(constrained_surface);
if (success) if (success)
pointer_constraint_delegate_ = delegate; pointer_constraint_delegate_ = delegate;
return success; return success;
......
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