Commit dcfcf94f authored by mdempsky@chromium.org's avatar mdempsky@chromium.org

Revert of Avoids releasing capture in EndMoveLoop if capture was switched to...

Revert of Avoids releasing capture in EndMoveLoop if capture was switched to another window while dragging (https://codereview.chromium.org/265843004/)

Reason for revert:
Appears to be responsible for ash_unittests failing on Linux ChromiumOS Tests(1): http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/43114

Original issue's description:
> Avoids releasing capture in EndMoveLoop if capture was switched to another window while dragging.
> This variant relies on checking if a drag input window still has capture before releasing the grab.
> A better alternative is in CL https://codereview.chromium.org/262893002/.
> 
> BUG=363503
> TEST=Follow the exact steps in the bug description.
> TEST=interactive_ui_tests --gtest_filter=*TabDragging*
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269593

TBR=sadrul@chromium.org,varkha@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=363503

Review URL: https://codereview.chromium.org/276163002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269629 0039d316-1c4b-4281-b951-d872f2087c98
parent 59b56e52
...@@ -62,7 +62,6 @@ X11WholeScreenMoveLoop::X11WholeScreenMoveLoop( ...@@ -62,7 +62,6 @@ X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(
should_reset_mouse_flags_(false), should_reset_mouse_flags_(false),
grab_input_window_(None), grab_input_window_(None),
canceled_(false), canceled_(false),
has_grab_(false),
weak_factory_(this) { weak_factory_(this) {
last_xmotion_.type = LASTEvent; last_xmotion_.type = LASTEvent;
} }
...@@ -137,11 +136,6 @@ uint32_t X11WholeScreenMoveLoop::DispatchEvent(const ui::PlatformEvent& event) { ...@@ -137,11 +136,6 @@ uint32_t X11WholeScreenMoveLoop::DispatchEvent(const ui::PlatformEvent& event) {
} }
break; break;
} }
case FocusOut: {
if (xev->xfocus.mode != NotifyGrab)
has_grab_ = false;
break;
}
case GenericEvent: { case GenericEvent: {
ui::EventType type = ui::EventTypeFromNative(xev); ui::EventType type = ui::EventTypeFromNative(xev);
switch (type) { switch (type) {
...@@ -259,11 +253,8 @@ void X11WholeScreenMoveLoop::EndMoveLoop() { ...@@ -259,11 +253,8 @@ void X11WholeScreenMoveLoop::EndMoveLoop() {
// Ungrab before we let go of the window. // Ungrab before we let go of the window.
XDisplay* display = gfx::GetXDisplay(); XDisplay* display = gfx::GetXDisplay();
// Only ungrab pointer if capture was not switched to another window.
if (has_grab_) {
XUngrabPointer(display, CurrentTime); XUngrabPointer(display, CurrentTime);
XUngrabKeyboard(display, CurrentTime); XUngrabKeyboard(display, CurrentTime);
}
// Restore the previous dispatcher. // Restore the previous dispatcher.
nested_dispatcher_.reset(); nested_dispatcher_.reset();
...@@ -304,7 +295,6 @@ bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) { ...@@ -304,7 +295,6 @@ bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) {
DLOG(ERROR) << "Grabbing pointer for dragging failed: " DLOG(ERROR) << "Grabbing pointer for dragging failed: "
<< ui::GetX11ErrorString(display, ret); << ui::GetX11ErrorString(display, ret);
} else { } else {
has_grab_ = true;
XUngrabKeyboard(display, CurrentTime); XUngrabKeyboard(display, CurrentTime);
ret = XGrabKeyboard( ret = XGrabKeyboard(
display, display,
......
...@@ -91,9 +91,6 @@ class X11WholeScreenMoveLoop : public ui::PlatformEventDispatcher { ...@@ -91,9 +91,6 @@ class X11WholeScreenMoveLoop : public ui::PlatformEventDispatcher {
// pressing escape). // pressing escape).
bool canceled_; bool canceled_;
// Keeps track of whether we still have a pointer grab at the end of the loop.
bool has_grab_;
// A Widget is created during the drag if there is an image available to be // A Widget is created during the drag if there is an image available to be
// used during the drag. // used during the drag.
scoped_ptr<Widget> drag_widget_; scoped_ptr<Widget> drag_widget_;
......
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