diff options
author | spang <spang@chromium.org> | 2015-11-17 08:48:39 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-17 16:50:12 +0000 |
commit | 7d96c973632aa4759c850d478e449c32e7597d13 (patch) | |
tree | 2b0165ae72bc4f3c46e67790011acaf88cf1a8ae /ui/platform_window | |
parent | c1685accc0bf3713e5a2ca570c30453cd4dfbfa4 (diff) | |
download | chromium_src-7d96c973632aa4759c850d478e449c32e7597d13.zip chromium_src-7d96c973632aa4759c850d478e449c32e7597d13.tar.gz chromium_src-7d96c973632aa4759c850d478e449c32e7597d13.tar.bz2 |
Fix inability to reacquire capture on Chrome OS
This switches WindowTreeHostPlatform class to always delegate capture
management to PlatformWindow without trying to maintain its own
has_capture_ member. It fixes a regression since r354585 where Chrome OS
cannot acquire capture after releasing it, which breaks dragging of
windows between displays.
The problem occurs because WindowTreeHostPlatform avoids calling
SetCapture() between ReleaseCapture() and OnLostCapture(), but Chrome OS
never calls OnLostCapture().
We could just update everyone to call OnLostCapture(), but it seems
simpler to just remove has_capture_ from WindowTreeHostPlatform and leave
the details to PlatformWindow. Several platforms do not implement capture
so this saves us from recording state that doesn't mean anything, and
other platforms such as Chrome OS do not allow preemption of capture, in
which case there's no reason to worry about OnLostCapture().
BUG=549294
Review URL: https://codereview.chromium.org/1440773002
Cr-Commit-Position: refs/heads/master@{#360092}
Diffstat (limited to 'ui/platform_window')
-rw-r--r-- | ui/platform_window/win/win_window.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/platform_window/win/win_window.cc b/ui/platform_window/win/win_window.cc index 1c6e4a9..802f2d7 100644 --- a/ui/platform_window/win/win_window.cc +++ b/ui/platform_window/win/win_window.cc @@ -90,8 +90,8 @@ void WinWindow::SetTitle(const base::string16& title) { } void WinWindow::SetCapture() { - DCHECK(::GetCapture() != hwnd()); - ::SetCapture(hwnd()); + if (::GetCapture() != hwnd()) + ::SetCapture(hwnd()); } void WinWindow::ReleaseCapture() { |