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

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

Issue 153893005: Makes it easier to snap or dock windows near the edges when using touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 | « ash/wm/workspace/snap_sizer.h ('k') | ash/wm/workspace/workspace_window_resizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/snap_sizer.cc
diff --git a/ash/wm/workspace/snap_sizer.cc b/ash/wm/workspace/snap_sizer.cc
index 6f17339d940ba3a29e885602113de41c8fe150fa..002473067f91c31d2fc7a89fb9c17e727c791d58 100644
--- a/ash/wm/workspace/snap_sizer.cc
+++ b/ash/wm/workspace/snap_sizer.cc
@@ -134,6 +134,9 @@ void SnapWindowToBounds(wm::WindowState* window_state,
} // namespace
+// static
+const int SnapSizer::kScreenEdgeInsetForTouchDrag = 32;
+
SnapSizer::SnapSizer(wm::WindowState* window_state,
const gfx::Point& start,
Edge edge,
@@ -285,7 +288,9 @@ gfx::Rect SnapSizer::GetTargetBounds() const {
bool SnapSizer::AlongEdge(int x) const {
gfx::Rect area(ScreenUtil::GetDisplayWorkAreaBoundsInParent(
window_state_->window()));
- return (x <= area.x()) || (x >= area.right() - 1);
+ int inset =
+ input_type_ == TOUCH_DRAG_INPUT ? kScreenEdgeInsetForTouchDrag : 0;
+ return (x <= area.x() + inset) || (x >= area.right() - 1 - inset);
}
} // namespace internal
« no previous file with comments | « ash/wm/workspace/snap_sizer.h ('k') | ash/wm/workspace/workspace_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698