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

Unified Diff: ash/wm/drag_window_resizer.cc

Issue 657603002: ash: ozone: apply transformation to events outside the root window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove explicit gfx::Rect to gfx::RectF conversion Created 6 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
Index: ash/wm/drag_window_resizer.cc
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc
index 214dbc5c730c3030b258dace74be5a933d2d7b72..c610465197d05c0cf4a1372812031ece62a41202 100644
--- a/ash/wm/drag_window_resizer.cc
+++ b/ash/wm/drag_window_resizer.cc
@@ -76,6 +76,9 @@ void DragWindowResizer::Drag(const gfx::Point& location, int event_flags) {
if (!resizer)
return;
+ if (!GetTarget()->HasCapture())
+ GetTarget()->SetCapture();
+
last_mouse_location_ = location;
// Show a phantom window for dragging in another root window.
if (HasSecondaryRootWindow()) {
@@ -103,6 +106,9 @@ void DragWindowResizer::CompleteDrag() {
const gfx::Display dst_display =
screen->GetDisplayNearestPoint(last_mouse_location_in_screen);
+ if (GetTarget()->HasCapture())
+ GetTarget()->ReleaseCapture();
+
if (dst_display.id() !=
screen->GetDisplayNearestWindow(GetTarget()->GetRootWindow()).id()) {
// Adjust the size and position so that it doesn't exceed the size of
@@ -140,6 +146,9 @@ void DragWindowResizer::RevertDrag() {
drag_window_controller_.reset();
GetTarget()->layer()->SetOpacity(details().initial_opacity);
+
+ if (GetTarget()->HasCapture())
+ GetTarget()->ReleaseCapture();
sadrul 2014/11/24 22:27:04 DnD and capture is relatively tricky. The changes
}
DragWindowResizer::DragWindowResizer(WindowResizer* next_window_resizer,

Powered by Google App Engine
This is Rietveld 408576698