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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 67403003: Don't lock the cursor when dragging or resizing a window with touch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 years, 1 month 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 | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 8687c8d5fe04e2868e5e2b6178a873c953158b11..8b19b784e8705cb5c70f7c566699ec78f1bd6b48 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -344,8 +344,10 @@ class WindowSize {
};
WorkspaceWindowResizer::~WorkspaceWindowResizer() {
- Shell* shell = Shell::GetInstance();
- shell->cursor_manager()->UnlockCursor();
+ if (did_lock_cursor_) {
+ Shell* shell = Shell::GetInstance();
+ shell->cursor_manager()->UnlockCursor();
+ }
if (instance_ == this)
instance_ = NULL;
}
@@ -505,6 +507,7 @@ WorkspaceWindowResizer::WorkspaceWindowResizer(
const std::vector<aura::Window*>& attached_windows)
: details_(details),
attached_windows_(attached_windows),
+ did_lock_cursor_(false),
did_move_or_resize_(false),
total_min_(0),
total_initial_size_(0),
@@ -514,8 +517,13 @@ WorkspaceWindowResizer::WorkspaceWindowResizer(
weak_ptr_factory_(this) {
DCHECK(details_.is_resizable);
- Shell* shell = Shell::GetInstance();
- shell->cursor_manager()->LockCursor();
+ // A mousemove should still show the cursor even if the window is
+ // being moved or resized with touch, so do not lock the cursor.
+ if (details.source != aura::client::WINDOW_MOVE_SOURCE_TOUCH) {
+ Shell* shell = Shell::GetInstance();
+ shell->cursor_manager()->LockCursor();
+ did_lock_cursor_ = true;
+ }
aura::Window* dock_container = Shell::GetContainer(
window()->GetRootWindow(), kShellWindowId_DockedContainer);
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698