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

Unified Diff: ui/views/mus/screen_mus.cc

Issue 1935083003: gfx::Screen: Replace GetWindowUnderCursor() with IsWindowUnderCursor(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Null checks Created 4 years, 8 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 | « ui/views/mus/screen_mus.h ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/screen_mus.cc
diff --git a/ui/views/mus/screen_mus.cc b/ui/views/mus/screen_mus.cc
index eb853388771be0aefb5a1c16fcb54293dcf13673..b3baf30c0766eade6eb9af228dafb8eec5582b3f 100644
--- a/ui/views/mus/screen_mus.cc
+++ b/ui/views/mus/screen_mus.cc
@@ -7,6 +7,7 @@
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "services/shell/public/cpp/connection.h"
#include "services/shell/public/cpp/connector.h"
+#include "ui/aura/window.h"
#include "ui/display/display_observer.h"
#include "ui/gfx/display_finder.h"
#include "ui/views/mus/screen_mus_delegate.h"
@@ -173,9 +174,12 @@ gfx::Point ScreenMus::GetCursorScreenPoint() {
return delegate_->GetCursorScreenPoint();
}
-gfx::NativeWindow ScreenMus::GetWindowUnderCursor() {
- NOTIMPLEMENTED();
- return nullptr;
+bool ScreenMus::IsWindowUnderCursor(gfx::NativeWindow window) {
+ if (!window)
+ return false;
+
+ return window->IsVisible() &&
sky 2016/05/02 23:59:37 IsVisible->IsDrawn
sky 2016/05/03 00:02:48 D'OH. IsVisible is what you want. Sorry.
Elliot Glaysher 2016/05/03 00:13:19 As discussed in person, this is an aura window, no
+ window->GetBoundsInScreen().Contains(GetCursorScreenPoint());
}
gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) {
« no previous file with comments | « ui/views/mus/screen_mus.h ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698