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

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

Issue 1957653003: mash: Don't close system tray bubble for clicks in menus/notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/window_manager_connection.h ('k') | ui/views/mus/window_manager_connection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/window_manager_connection.cc
diff --git a/ui/views/mus/window_manager_connection.cc b/ui/views/mus/window_manager_connection.cc
index f52771ad4d01ac89d58e7b4cfd6f50dcf773cec5..a76ffa6ebd4ec84bc7d4f6d1166273d579a2bfba 100644
--- a/ui/views/mus/window_manager_connection.cc
+++ b/ui/views/mus/window_manager_connection.cc
@@ -142,21 +142,28 @@ void WindowManagerConnection::OnEmbed(mus::Window* root) {}
void WindowManagerConnection::OnConnectionLost(
mus::WindowTreeConnection* connection) {}
-void WindowManagerConnection::OnEventObserved(const ui::Event& event) {
+void WindowManagerConnection::OnEventObserved(const ui::Event& event,
+ mus::Window* target) {
if (!event.IsLocatedEvent())
return;
+ Widget* target_widget = nullptr;
+ if (target) {
+ mus::Window* root = target->GetRoot();
+ target_widget = NativeWidgetMus::GetWidgetForWindow(root);
+ }
+
// The mojo input events type converter uses the event root_location field
// to store screen coordinates. Screen coordinates really should be returned
// separately. See http://crbug.com/608547
gfx::Point location_in_screen = event.AsLocatedEvent()->root_location();
if (event.type() == ui::ET_MOUSE_PRESSED) {
- FOR_EACH_OBSERVER(
- PointerWatcher, pointer_watchers_,
- OnMousePressed(*event.AsMouseEvent(), location_in_screen));
+ FOR_EACH_OBSERVER(PointerWatcher, pointer_watchers_,
+ OnMousePressed(*event.AsMouseEvent(), location_in_screen,
+ target_widget));
} else if (event.type() == ui::ET_TOUCH_PRESSED) {
- FOR_EACH_OBSERVER(
- PointerWatcher, pointer_watchers_,
- OnTouchPressed(*event.AsTouchEvent(), location_in_screen));
+ FOR_EACH_OBSERVER(PointerWatcher, pointer_watchers_,
+ OnTouchPressed(*event.AsTouchEvent(), location_in_screen,
+ target_widget));
}
}
« no previous file with comments | « ui/views/mus/window_manager_connection.h ('k') | ui/views/mus/window_manager_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698