diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 21:18:28 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 21:18:28 +0000 |
commit | b782a307441a47a0ed1155533ac9995d2634b749 (patch) | |
tree | 12fbb95cfca0250aec0a513526c8061dcbd887f1 /ui | |
parent | a5cc9cc08c70d3370801dac73c02912e17a1f4d5 (diff) | |
download | chromium_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.cc | 3 |
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 { |