summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-17 21:18:28 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-17 21:18:28 +0000
commitb782a307441a47a0ed1155533ac9995d2634b749 (patch)
tree12fbb95cfca0250aec0a513526c8061dcbd887f1 /ui
parenta5cc9cc08c70d3370801dac73c02912e17a1f4d5 (diff)
downloadchromium_src-b782a307441a47a0ed1155533ac9995d2634b749.zip
chromium_src-b782a307441a47a0ed1155533ac9995d2634b749.tar.gz
chromium_src-b782a307441a47a0ed1155533ac9995d2634b749.tar.bz2
Don't release capture when this window doesn't already have it
- frame called ::SetCapture - mouse down on menu button - menu opens and calls ::SetCapture - Windows notifies frame that it's lost capture - The DesktopCaptureClient release its internal capture state, but also releases native capture - which releases the menu's capture, not its capture. This makes sure that the window that's releasing capture is really the one that has it. R=ben@chromium.org BUG=232155 Review URL: https://codereview.chromium.org/14312007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/win/hwnd_message_handler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 73b9f65..7dbbf71 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -720,7 +720,8 @@ void HWNDMessageHandler::SetCapture() {
}
void HWNDMessageHandler::ReleaseCapture() {
- ::ReleaseCapture();
+ if (HasCapture())
+ ::ReleaseCapture();
}
bool HWNDMessageHandler::HasCapture() const {