New issue
Advanced search Search tips

Issue 599142 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug
mus



Sign in to add a comment

mash: System tray bubble does not dismiss after click outside bounds

Project Member Reported by jamescook@chromium.org, Mar 30 2016

Issue description

Actually, it cannot be dismissed at all. This makes it hard to work on.

This happens even if the painting problem (it's blank) is worked around.

Perhaps something is wrong with event routing or capture.  I'll take a look.

 

Comment 1 by msw@chromium.org, Mar 30 2016

The inability to capture events outside the bubble area is likely related.

For example, with tooltips, we add a pre target handler to the root aura window to capture touch events outside the shelf, but that doesn't work on our current mus setup, because the root window is the size of the shelf, not the entire desktop, and you can't easily hook events outside your mus window. I wonder if that bubble works similarly; TrayBubbleView always worked a bit differently from other bubbles (which I know much better).

Forcing TrayBubbleView's can_activate to true might make close_on_deactivate work.
You could also try BubbleDelegateView::set_close_on_esc(true), at least for testing.
https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/bubble/tray_bubble_view.cc&l=282
The system tray bubble does not use mouse capture to decide when to close. It has custom close behavior created by TrayEventFilter, which is installed on the ash::Shell as-a EventTarget.

The TrayEventFilter has custom logic for behaviors like not closing the tray on click if there is a notification window open above it (since that would shift the position of the notification window):

https://code.google.com/p/chromium/codesearch#chromium/src/ash/system/tray/tray_event_filter.cc

In mustash the Shell EventFilter is created, but doesn't seem to get any events. This might happen because of the existing event routing architecture.

Talked to Sadrul....

Events go directly from the mus window server into the mus::WindowTreeClientImpl into NativeWidgetMus and from there into views::Widget. It bypasses the aura-window/ash-shell event processing layer.

Basically, there's no way to do a global pre-target handler like the existing event filters in Ash. The window server doesn't want to talk to each running mojo app and ask it if it wants to handle an event -- that's too slow. Mouse events either go to the window under the cursor or the window capturing the mouse.

Right now there are ~10 pre-target handlers registered in ash::Shell. None of these are going to work, and we need to find workarounds.

In this case it might be OK to have the tray bubble capture the mouse, similar to how context menus work. This won't be exactly right, as the event filter is doing some interesting stuff with popup notifications, but it could be close. This will need to be refactored so that the existing Chrome OS Ash behavior is preserved, but we can do the new thing under mus.

Comment 4 by msw@chromium.org, Mar 31 2016

Will capturing the mouse also give you touch events?
(we'll need to close when touching outside the window)
Sadrul, do you know if mouse capture in Mus also gives you touch capture?

msw@, did you find a way to simulate touch events when running on your Linux desktop?

Cc: jonr...@chromium.org
I believe it does, yes. +jonross@ to confirm
To simulate touch events using a mouse, you can use --touch-devices=X (where X is the device-id listed in 'xinput list') flag, I think it should work.
Mus does implicit capture on a per-pointer basis (separate for mouse/touch)
Mus' explicit capture covers all mouse+touch. This is what menus use for self-dismissal.

For other pre-target handlers Mus supports pre-target accelerators. We may be able to map some of those over.
In addition to the TrayEventFilter discussed above, there is another way the bubble closes itself. The bubble is a widget that listens for itself to be deactivated. When that happens it closes. You can see this behavior on a Chromebook by opening a browser window, opening the system tray bubble, then hitting alt-tab. When the browser window activates itself the bubble loses activation and closes.

This is broken for several reasons: NativeWidgetMus::drawn_ is never true (sky is working on this), NativeWidgetMus isn't notifying the Widget of activation change, and the bubble is in the MENUS container, which doesn't allow activation.

I'm close to having a patch for the latter 2 issues, which will fix the deactivation case. However, this doesn't fix the common case of closing the bubble via clicking on the desktop.

The TrayEventFilter/EventHandler case will need to be fixed with something like mouse capture, as described above.

Project Member

Comment 10 by bugdroid1@chromium.org, Apr 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d80523229c7a5b7b48647d0ca24c61ad6376c354

commit d80523229c7a5b7b48647d0ca24c61ad6376c354
Author: jamescook <jamescook@chromium.org>
Date: Fri Apr 08 17:37:35 2016

mash: Make system tray bubble close when another window is activated

This is one of two code paths by which the system tray bubble closes, and is
a common mechanism for other bubbles to close.

* Introduce a container for bubbles in mash::wm, similar to the Ash bubble
container. Place bubbles there, instead of in the menus container.
* Allow that container to have activatable windows as children.
* Propagate widget activation changes from NativeWidgetMus to Widget.

Note: This does not entirely fix the problem, as the mus::Window::drawn_ state
is incorrect. Once that is fixed the bubbles will close properly. For now this
can be forced true by changing the mus::Window constructor.

BUG= 599142 
TEST=added to views_mus_unittests, also open system tray bubble then press
alt-tab to activate a window, bubble closes

Review URL: https://codereview.chromium.org/1863523006

Cr-Commit-Position: refs/heads/master@{#386118}

[modify] https://crrev.com/d80523229c7a5b7b48647d0ca24c61ad6376c354/ash/mus/sysui_application.cc
[modify] https://crrev.com/d80523229c7a5b7b48647d0ca24c61ad6376c354/mash/wm/public/interfaces/container.mojom
[modify] https://crrev.com/d80523229c7a5b7b48647d0ca24c61ad6376c354/mash/wm/root_window_controller.cc
[modify] https://crrev.com/d80523229c7a5b7b48647d0ca24c61ad6376c354/ui/views/bubble/tray_bubble_view.h
[modify] https://crrev.com/d80523229c7a5b7b48647d0ca24c61ad6376c354/ui/views/mus/native_widget_mus.cc
[modify] https://crrev.com/d80523229c7a5b7b48647d0ca24c61ad6376c354/ui/views/mus/native_widget_mus_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Apr 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5eb778dc5a2a4762fe95d67f2adc151f928d7939

commit 5eb778dc5a2a4762fe95d67f2adc151f928d7939
Author: jamescook <jamescook@chromium.org>
Date: Mon Apr 11 16:30:34 2016

mash: Close system tray bubble on click outside its bounds, part 1

Mus does not support global event handlers, so the existing TrayEventFilter
cannot be used to close the bubble. Instead we use mouse capture.

* Capture the mouse explicitly when the bubble is spawned and release it on
clicks outside its bounds.
* Always close the bubble on capture loss, in case some other part of the
window system breaks capture.

Also fix an issue with auto-release-capture at the widget level. If a view
explicitly requested capture via Widget::SetCapture(my_view) and explicitly
did not request auto-release-capture, then any mouse release event would
cause the view to lose capture (that is, being an explicit mouse handler
target at the RootView level). Fix this so that these sorts of views will
continue to receive events until they explicit release capture.

Note that this code still eats the mousedown event that causes the bubble to
close. Fixing that is part 2.

BUG= 599142 

Review URL: https://codereview.chromium.org/1876553002

Cr-Commit-Position: refs/heads/master@{#386402}

[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ash/system/tray/system_tray.cc
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/bubble/tray_bubble_view.cc
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/bubble/tray_bubble_view.h
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/mus/platform_window_mus.cc
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/widget/root_view.cc
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/widget/root_view.h
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/widget/widget.cc
[modify] https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939/ui/views/widget/widget_interactive_uitest.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Apr 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e486340dce9cd2aac9451efaa722d285e560fada

commit e486340dce9cd2aac9451efaa722d285e560fada
Author: jamescook <jamescook@chromium.org>
Date: Thu Apr 14 23:54:20 2016

Revert of mash: Close system tray bubble on click outside its bounds, part 1 (patchset #4 id:60001 of https://codereview.chromium.org/1876553002/ )

Reason for revert:
Breaks clicking in the system tray bubble on mus. We need an entirely different architecture for this.

Original issue's description:
> mash: Close system tray bubble on click outside its bounds, part 1
>
> Mus does not support global event handlers, so the existing TrayEventFilter
> cannot be used to close the bubble. Instead we use mouse capture.
>
> * Capture the mouse explicitly when the bubble is spawned and release it on
> clicks outside its bounds.
> * Always close the bubble on capture loss, in case some other part of the
> window system breaks capture.
>
> Also fix an issue with auto-release-capture at the widget level. If a view
> explicitly requested capture via Widget::SetCapture(my_view) and explicitly
> did not request auto-release-capture, then any mouse release event would
> cause the view to lose capture (that is, being an explicit mouse handler
> target at the RootView level). Fix this so that these sorts of views will
> continue to receive events until they explicit release capture.
>
> Note that this code still eats the mousedown event that causes the bubble to
> close. Fixing that is part 2.
>
> BUG= 599142 
>
> Committed: https://crrev.com/5eb778dc5a2a4762fe95d67f2adc151f928d7939
> Cr-Commit-Position: refs/heads/master@{#386402}

TBR=sky@chromium.org,msw@chromium.org,sadrul@chromium.org
BUG= 599142 

Review URL: https://codereview.chromium.org/1887273002

Cr-Commit-Position: refs/heads/master@{#387479}

[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ash/system/tray/system_tray.cc
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/bubble/tray_bubble_view.cc
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/bubble/tray_bubble_view.h
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/mus/platform_window_mus.cc
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/widget/root_view.cc
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/widget/root_view.h
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/widget/widget.cc
[modify] https://crrev.com/e486340dce9cd2aac9451efaa722d285e560fada/ui/views/widget/widget_interactive_uitest.cc

I'm going to try a different approach that may help us in the future with EventHandlers/EventFilters/MouseWatchers.

ash_sysui will register itself with the window server as an "EventObserver". It will get a stream of input events that it can passively observe. The WS will not expect ACKs on those events, it's a one-way stream. This won't add latency to normal events; they will be delivered as they are now.

The tray bubble will register a "PointerWatcher" on its WindowTreeConnection. It will get notified of pointer-down events and use them to decide when to close the bubble. This is similar to how TrayEventFilter works today.

Project Member

Comment 14 by bugdroid1@chromium.org, Apr 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46fcd654384263357e045cb538e655e62a11f3f4

commit 46fcd654384263357e045cb538e655e62a11f3f4
Author: jamescook <jamescook@chromium.org>
Date: Sat Apr 23 00:03:07 2016

mus: Add EventObserver to allow passively listening to UI events

In order to close the system tray bubble, ash_sysui needs to be able
to listen for events that are not targeted to its windows.

* Add a SetEventObserver/ClearEventObserver interface to WindowTree.
* Event observers are set using the same mojom::EventMatchers used
  by accelerators.
* The window server tests incoming events from any display and sends
  them to all WindowTrees with a matching event observer that belong
  to the same user.

A follow-up CL will add a client-side "PointerWatcher" mechanism and
use it in ash_sysui to close the tray bubble.

BUG= 599142 
TEST=added to mus_ws_unittests

Review URL: https://codereview.chromium.org/1909733002

Cr-Commit-Position: refs/heads/master@{#389315}

[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/BUILD.gn
[rename] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/event_matcher_util.h
[rename] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/lib/event_matcher_util.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/lib/window_tree_client_impl.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/lib/window_tree_client_impl.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/tests/test_window_tree.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/tests/test_window_tree.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/interfaces/input_event_matcher.mojom
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/interfaces/window_tree.mojom
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/BUILD.gn
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/accelerator.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/accelerator.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_dispatcher.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_dispatcher_delegate.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_dispatcher_unittest.cc
[add] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_matcher.cc
[add] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_matcher.h
[add] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_matcher_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_change_tracker.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_change_tracker.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_utils.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_utils.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_manager_state.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_manager_state.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_manager_state_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_server.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_server.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree_client_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/browser_driver/browser_driver_application_delegate.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/wm/accelerator_registrar_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/wm/root_window_controller.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/wm/window_manager_application.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Apr 25 2016

Labels: merge-merged-2716
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46fcd654384263357e045cb538e655e62a11f3f4

commit 46fcd654384263357e045cb538e655e62a11f3f4
Author: jamescook <jamescook@chromium.org>
Date: Sat Apr 23 00:03:07 2016

mus: Add EventObserver to allow passively listening to UI events

In order to close the system tray bubble, ash_sysui needs to be able
to listen for events that are not targeted to its windows.

* Add a SetEventObserver/ClearEventObserver interface to WindowTree.
* Event observers are set using the same mojom::EventMatchers used
  by accelerators.
* The window server tests incoming events from any display and sends
  them to all WindowTrees with a matching event observer that belong
  to the same user.

A follow-up CL will add a client-side "PointerWatcher" mechanism and
use it in ash_sysui to close the tray bubble.

BUG= 599142 
TEST=added to mus_ws_unittests

Review URL: https://codereview.chromium.org/1909733002

Cr-Commit-Position: refs/heads/master@{#389315}

[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/BUILD.gn
[rename] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/event_matcher_util.h
[rename] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/lib/event_matcher_util.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/lib/window_tree_client_impl.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/lib/window_tree_client_impl.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/tests/test_window_tree.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/tests/test_window_tree.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/interfaces/input_event_matcher.mojom
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/public/interfaces/window_tree.mojom
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/BUILD.gn
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/accelerator.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/accelerator.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_dispatcher.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_dispatcher_delegate.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_dispatcher_unittest.cc
[add] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_matcher.cc
[add] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_matcher.h
[add] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/event_matcher_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_change_tracker.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_change_tracker.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_utils.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/test_utils.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_manager_state.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_manager_state.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_manager_state_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_server.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_server.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree.h
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree_client_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/components/mus/ws/window_tree_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/browser_driver/browser_driver_application_delegate.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/wm/accelerator_registrar_unittest.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/wm/root_window_controller.cc
[modify] https://crrev.com/46fcd654384263357e045cb538e655e62a11f3f4/mash/wm/window_manager_application.cc

Fixes out for review:
https://codereview.chromium.org/1921673005/ Adds PointerWatcher
https://codereview.chromium.org/1918183003/ Closes the bubble

msw, the former might be useful for tooltips and touch events.


Project Member

Comment 17 by bugdroid1@chromium.org, Apr 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/214fcbde97eec5f468f0de0561a3f0eb26571a9f

commit 214fcbde97eec5f468f0de0561a3f0eb26571a9f
Author: jamescook <jamescook@chromium.org>
Date: Thu Apr 28 01:16:06 2016

mus: Add PointerWatcher for passively observing mouse and touch events

This will support closing the system tray bubble when clicking outside
its bounds. It also provides a path for converting existing ui::EventHandlers
that are used to observe events that occur outside of existing widgets.

Dependent CL https://codereview.chromium.org/1918183003 implements closing the tray bubble.

BUG= 599142 
TEST=added to views_mus_unittests and mojo_view_manager_lib_unittests

Review-Url: https://codereview.chromium.org/1921673005
Cr-Commit-Position: refs/heads/master@{#390267}

[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/ash.gyp
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/mus/BUILD.gn
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/mus/pointer_watcher_delegate_mus.cc
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/mus/pointer_watcher_delegate_mus.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/mus/shell_delegate_mus.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/mus/shell_delegate_mus.h
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/pointer_watcher_delegate.h
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/pointer_watcher_delegate_aura.cc
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/pointer_watcher_delegate_aura.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/shell.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/shell.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/shell/shell_delegate_impl.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/shell/shell_delegate_impl.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/shell_delegate.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/test/test_shell_delegate.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ash/test/test_shell_delegate.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/chrome/browser/ui/ash/chrome_shell_delegate.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/chrome/browser/ui/ash/chrome_shell_delegate.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/demo/mus_demo.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/demo/mus_demo.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/lib/window_tree_client_impl.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/lib/window_tree_client_impl.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/tests/window_server_test_base.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/tests/window_server_test_base.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/window_tree_connection.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/components/mus/public/cpp/window_tree_delegate.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/content/renderer/mus/compositor_mus_connection.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/content/renderer/mus/compositor_mus_connection.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/mash/wm/root_window_controller.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/mash/wm/root_window_controller.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/mash/wm/window_manager_unittest.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/mus/BUILD.gn
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/mus/window_manager_connection.cc
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/mus/window_manager_connection.h
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/mus/window_manager_connection_unittest.cc
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/pointer_watcher.h
[modify] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/views.gyp
[add] https://crrev.com/214fcbde97eec5f468f0de0561a3f0eb26571a9f/ui/views/views_exports.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6f1890e148dce5db019b2a6796f94f1e5a10be7

commit d6f1890e148dce5db019b2a6796f94f1e5a10be7
Author: jamescook <jamescook@chromium.org>
Date: Thu Apr 28 05:04:31 2016

mash: Close the system tray bubble on click outside its bounds

* Use PointerWatcher to observe for clicks outside the widget bounds
* Add ScreenPositionClientMus to correctly transform the click locations

This changes the behavior of the system tray bubble on classic ash. Clicks
outside the bubble will now be handled (e.g. you can click outside the bubble
and start dragging a window). This is consistent with the menu behavior of
the hamburger menu and similar system tray bubbles on Windows. I've cleared
with PM kuscher@ that we want this behavior change.

Depends on https://codereview.chromium.org/1921673005/

BUG= 599142 
TEST=Run mash, click outside bubble, it closes. Ditto for ash. In both cases
you can start a window drag, click on a web page, etc. with the same click.

Review-Url: https://codereview.chromium.org/1918183003
Cr-Commit-Position: refs/heads/master@{#390304}

[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/chromeos/session/logout_button_tray.cc
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/chromeos/session/logout_button_tray.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/overview/overview_button_tray.cc
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/overview/overview_button_tray.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/tray/system_tray.cc
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/tray/system_tray.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/tray/tray_background_view.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/tray/tray_event_filter.cc
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/tray/tray_event_filter.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/web_notification/web_notification_tray.cc
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ash/system/web_notification/web_notification_tray.h
[modify] https://crrev.com/d6f1890e148dce5db019b2a6796f94f1e5a10be7/ui/views/mus/native_widget_mus.cc

Status: Fixed (was: Started)
Status: Started (was: Fixed)
This is still wrong on mus with respect to open menus (clicks on menus shouldn't close it) and open notification bubbles.

Project Member

Comment 21 by bugdroid1@chromium.org, May 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0127a907b020c66d437da23e7b1539b80c7784a7

commit 0127a907b020c66d437da23e7b1539b80c7784a7
Author: jamescook <jamescook@chromium.org>
Date: Fri May 06 15:38:24 2016

mash: Add status area container to mash window manager

Previously the ash status container and the ash shelf containers were both
mapped to the mash "user shelf" container. However, the "status" container
container includes both the status area widget and popups for status
notifications (e.g. message center notifications, screenshot taken, etc.).

Creating a separate container allows existing ash code running on mus to test
if a particular widget is in the status container and not the shelf container.
This is needed for the system tray bubble code.

BUG= 599142 
TEST=existing mash_unittests, manually set shelf position to left/bottom/right

Review-Url: https://codereview.chromium.org/1950293003
Cr-Commit-Position: refs/heads/master@{#392062}

[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/ash/mus/sysui_application.cc
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/BUILD.gn
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/property_util.cc
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/property_util.h
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/public/interfaces/container.mojom
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/root_window_controller.cc
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/root_window_controller.h
[delete] https://crrev.com/31b3f92d54c7322b46d6ef656422e96ec0c0d37c/mash/wm/shelf_layout.cc
[delete] https://crrev.com/31b3f92d54c7322b46d6ef656422e96ec0c0d37c/mash/wm/shelf_layout.h
[add] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/shelf_layout_impl.cc
[add] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/shelf_layout_impl.h
[add] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/shelf_layout_manager.cc
[add] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/shelf_layout_manager.h
[add] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/status_layout_manager.cc
[add] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/status_layout_manager.h
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/window_manager_application.cc
[modify] https://crrev.com/0127a907b020c66d437da23e7b1539b80c7784a7/mash/wm/window_manager_application.h

Project Member

Comment 22 by bugdroid1@chromium.org, May 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa

commit e9f5f0c1aa477afc87c4c42004d6f5f1077048fa
Author: jamescook <jamescook@chromium.org>
Date: Mon May 09 18:22:14 2016

mash: Don't close system tray bubble for clicks in menus/notifications

* Plumb the hit mus::Window through the client WindowManagerConnection event
  observers
* Add the hit widget to PointerWatcher.
* Remove the event from PointerWatcher, since the target isn't valid on mus
  and the client cannot set handled or stop propagation.
* Add ContainerDelegate to ash to allow checking if a given widget is in a
  particular window container.
* Convert TrayEventFilter to use the new container delegate.

BUG= 608570 , 599142 
TEST=existing ash_unittests, views_mus_unittests
TBR=ben@chromium.org for no-op method signature change in content/renderer/mus/

Review-Url: https://codereview.chromium.org/1957653003
Cr-Commit-Position: refs/heads/master@{#392366}

[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/ash.gyp
[add] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/container_delegate.h
[add] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/container_delegate_aura.cc
[add] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/container_delegate_aura.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/mus/BUILD.gn
[add] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/mus/container_delegate_mus.cc
[add] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/mus/container_delegate_mus.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/mus/shell_delegate_mus.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/mus/shell_delegate_mus.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/pointer_watcher_delegate_aura.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/pointer_watcher_delegate_aura.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shelf/overflow_bubble.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shelf/overflow_bubble.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shelf/shelf_tooltip_manager.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shelf/shelf_tooltip_manager.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shell.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shell.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shell/shell_delegate_impl.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shell/shell_delegate_impl.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/shell_delegate.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/system/status_area_widget.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/system/status_area_widget.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/system/tray/tray_event_filter.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/system/tray/tray_event_filter.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/test/test_shell_delegate.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ash/test/test_shell_delegate.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/chrome/browser/ui/ash/chrome_shell_delegate.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/chrome/browser/ui/ash/chrome_shell_delegate.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/demo/mus_demo.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/demo/mus_demo.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/public/cpp/lib/window_tree_client_impl.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/public/cpp/tests/window_server_test_base.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/public/cpp/tests/window_server_test_base.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/components/mus/public/cpp/window_tree_delegate.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/content/renderer/mus/compositor_mus_connection.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/content/renderer/mus/compositor_mus_connection.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/mash/wm/root_window_controller.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/mash/wm/root_window_controller.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/mash/wm/window_manager_unittest.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ui/views/mus/native_widget_mus.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ui/views/mus/native_widget_mus.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ui/views/mus/window_manager_connection.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ui/views/mus/window_manager_connection.h
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ui/views/mus/window_manager_connection_unittest.cc
[modify] https://crrev.com/e9f5f0c1aa477afc87c4c42004d6f5f1077048fa/ui/views/pointer_watcher.h

Status: Fixed (was: Started)
Finally fixed.

Components: -MUS Internals>Services>WindowService

Sign in to add a comment