Commit cdd13aa0 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

exo: Use DESCENDANTS_ONLY event targeting policy for mus/mash

TARGET_AND_DESCENDANTS event targeting policy does not work properly
under mus/mash. As a result, mouse events are not delivered to
the windows under ExoShellSurface in SystemModalContainer even though
ExoShellSurface says it does not handle the events.

Use DESCENDANTS_ONLY for mus/mash until event dispatching code is
fixed to handle such case.

Bug: 839521
Change-Id: I8e949164d2cd9666468a8995d0bdb8e29f6b9301
Reviewed-on: https://chromium-review.googlesource.com/1044542
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556176}
parent 38cb0013
...@@ -7,11 +7,13 @@ ...@@ -7,11 +7,13 @@
#include <algorithm> #include <algorithm>
#include "ash/frame/custom_frame_view_ash.h" #include "ash/frame/custom_frame_view_ash.h"
#include "ash/public/cpp/config.h"
#include "ash/public/cpp/shelf_types.h" #include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
#include "ash/public/cpp/window_state_type.h" #include "ash/public/cpp/window_state_type.h"
#include "ash/public/interfaces/window_pin_type.mojom.h" #include "ash/public/interfaces/window_pin_type.mojom.h"
#include "ash/shell.h"
#include "ash/wm/drag_window_resizer.h" #include "ash/wm/drag_window_resizer.h"
#include "ash/wm/window_resizer.h" #include "ash/wm/window_resizer.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
...@@ -1203,10 +1205,13 @@ void ShellSurfaceBase::CreateShellSurfaceWidget( ...@@ -1203,10 +1205,13 @@ void ShellSurfaceBase::CreateShellSurfaceWidget(
window->SetProperty(aura::client::kAccessibilityFocusFallsbackToWidgetKey, window->SetProperty(aura::client::kAccessibilityFocusFallsbackToWidgetKey,
false); false);
window->AddChild(host_window()); window->AddChild(host_window());
// The window of widget_ is a container window. It doesn't handle pointer // Use DESCENDANTS_ONLY event targeting policy for mus/mash.
// events. // TODO(https://crbug.com/839521): Revisit after event dispatching code is
// changed for mus/mash.
window->SetEventTargetingPolicy( window->SetEventTargetingPolicy(
ui::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS); ash::Shell::GetAshConfig() == ash::Config::CLASSIC
? ui::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS
: ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY);
window->SetEventTargeter(base::WrapUnique( window->SetEventTargeter(base::WrapUnique(
new CustomWindowTargeter(widget_, client_controlled_move_resize_))); new CustomWindowTargeter(widget_, client_controlled_move_resize_)));
SetApplicationId(window, application_id_); SetApplicationId(window, application_id_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment