Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: content/browser/media/capture/aura_window_capture_machine.cc

Issue 1413803002: Window capture stop draw cursor when it points to the hidden content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/aura_window_capture_machine.cc
diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc
index 9d2de8880746d9a3d29d56c2d791c391f5264d2f..334477fd541b647136910db4007b0cccc812afbe 100644
--- a/content/browser/media/capture/aura_window_capture_machine.cc
+++ b/content/browser/media/capture/aura_window_capture_machine.cc
@@ -30,6 +30,7 @@
#include "ui/compositor/dip_util.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/screen.h"
+#include "ui/wm/public/activation_client.h"
namespace content {
@@ -413,6 +414,19 @@ gfx::Point AuraWindowCaptureMachine::UpdateCursorState(
return gfx::Point();
}
+ // Return early if the target content pointed by the mouse is hidden.
+ aura::client::ActivationClient* activation_client =
+ aura::client::GetActivationClient(desktop_window_->GetRootWindow());
+ DCHECK(activation_client);
+ aura::Window* active_window = activation_client->GetActiveWindow();
+ DCHECK(active_window);
+ if (active_window != desktop_window_) {
+ if (active_window->GetBoundsInScreen().Contains(cursor_position)) {
miu 2015/10/19 19:49:47 This mostly works. It wouldn't if there were TWO
xjz 2015/10/20 00:03:21 Done.
+ ClearCursorState();
+ return gfx::Point();
+ }
+ }
+
gfx::NativeCursor cursor = desktop_window_->GetHost()->last_cursor();
gfx::Point cursor_hot_point;
if (last_cursor_ != cursor ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698