summaryrefslogtreecommitdiffstats
path: root/ui/platform_window/win
diff options
context:
space:
mode:
authorspang <spang@chromium.org>2015-11-17 08:48:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-17 16:50:12 +0000
commit7d96c973632aa4759c850d478e449c32e7597d13 (patch)
tree2b0165ae72bc4f3c46e67790011acaf88cf1a8ae /ui/platform_window/win
parentc1685accc0bf3713e5a2ca570c30453cd4dfbfa4 (diff)
downloadchromium_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/win')
-rw-r--r--ui/platform_window/win/win_window.cc4
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() {