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

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

Issue 58973004: Increase tolerance for touch-snapping near the screen edges (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Increase tolerance for touch-snapping near the screen edges (test) 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/system_gesture_event_filter_unittest.cc ('k') | no next file » | 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 e788b6301b9b0fdffc85af96ac8937b656ef8b7a..b6ab647ae7c18b73a50dff41c63c682ed9e14f42 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -998,6 +998,18 @@ SnapType WorkspaceWindowResizer::GetSnapType(
// TODO: this likely only wants total display area, not the area of a single
// display.
gfx::Rect area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window()));
+ if (details_.source == aura::client::WINDOW_MOVE_SOURCE_TOUCH) {
+ // Increase tolerance for touch-snapping near the screen edges. This is only
+ // necessary when the work area left or right edge is same as screen edge.
+ gfx::Rect display_bounds(ScreenAsh::GetDisplayBoundsInParent(window()));
+ int inset_left = 0;
+ if (area.x() == display_bounds.x())
+ inset_left = kScreenEdgeInsetForTouchResize;
+ int inset_right = 0;
+ if (area.right() == display_bounds.right())
+ inset_right = kScreenEdgeInsetForTouchResize;
+ area.Inset(inset_left, 0, inset_right, 0);
+ }
if (location.x() <= area.x())
return SNAP_LEFT;
if (location.x() >= area.right() - 1)
« no previous file with comments | « ash/wm/system_gesture_event_filter_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698