summaryrefslogtreecommitdiffstats
path: root/ash/ui_controls_ash.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-28 23:30:47 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-28 23:30:47 +0000
commit6a619f6c9f6c2bad5914e41062b6623516079af4 (patch)
treef93864a8445c3be0572530c1835ab2f3dccf1aba /ash/ui_controls_ash.cc
parent86d203a607bec39e5fad47290b6876c846483315 (diff)
downloadchromium_src-6a619f6c9f6c2bad5914e41062b6623516079af4.zip
chromium_src-6a619f6c9f6c2bad5914e41062b6623516079af4.tar.gz
chromium_src-6a619f6c9f6c2bad5914e41062b6623516079af4.tar.bz2
Fix ui_controls with multiple displays. Currently the code uses the ui
controls based on the rootwindow that contains the point we're moving to. This is wrong if a capture exists, since with capture the events are received from the root with capture. BUG=136919 TEST=none R=oshima@chromium.org Review URL: https://chromiumcodereview.appspot.com/10886019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ui_controls_ash.cc')
-rw-r--r--ash/ui_controls_ash.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ash/ui_controls_ash.cc b/ash/ui_controls_ash.cc
index 4c60c54..7463a53 100644
--- a/ash/ui_controls_ash.cc
+++ b/ash/ui_controls_ash.cc
@@ -6,6 +6,7 @@
#include "ash/shell_factory.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/window_properties.h"
+#include "ui/aura/client/capture_client.h"
#include "ui/aura/root_window.h"
#include "ui/aura/ui_controls_aura.h"
#include "ui/gfx/screen.h"
@@ -34,6 +35,13 @@ ui_controls::UIControlsAura* GetUIControlsForRootWindow(
// absolute screen coordinates. NULL if there is no RootWindow under the
// |point|.
ui_controls::UIControlsAura* GetUIControlsAt(const gfx::Point& point) {
+ // If there is a capture events must be relative to it.
+ aura::client::CaptureClient* capture_client =
+ GetCaptureClient(ash::Shell::GetInstance()->GetPrimaryRootWindow());
+ if (capture_client && capture_client->GetCaptureWindow()) {
+ return GetUIControlsForRootWindow(
+ capture_client->GetCaptureWindow()->GetRootWindow());
+ }
aura::RootWindow* root = wm::GetRootWindowAt(point);
return root ? GetUIControlsForRootWindow(root) : NULL;
}