From 81b5cb0d50df07fd6959ee8d8a2f2601ce921401 Mon Sep 17 00:00:00 2001 From: zverre Date: Mon, 1 Feb 2016 10:27:59 -0800 Subject: Allow all non-activatable windows to process clicks This rolls back what was previosuly done in https://codereview.chromium.org/1565713002 because simpler approach has been found. Now every window that's been created with ACTIVATABLE_NO flag can process clicks and remain unfocused. BUG= Review URL: https://codereview.chromium.org/1619523002 Cr-Commit-Position: refs/heads/master@{#372691} --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc | 3 ++- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h | 4 ++++ ui/views/widget/widget.h | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'ui/views') diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc index c354154..f79b3c4 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -125,6 +125,7 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window, const Widget::InitParams& params) { // TODO(beng): SetInitParams(). content_window_ = content_window; + wants_mouse_events_when_inactive_ = params.wants_mouse_events_when_inactive; aura::client::SetAnimationHost(content_window_, this); @@ -626,7 +627,7 @@ bool DesktopWindowTreeHostWin::CanActivate() const { } bool DesktopWindowTreeHostWin::WantsMouseEventsWhenInactive() const { - return false; + return wants_mouse_events_when_inactive_; } bool DesktopWindowTreeHostWin::WidgetSizeIsClientSize() const { diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h index ad82485..963658a 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h @@ -256,6 +256,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin scoped_ptr tooltip_disabler_; + // Indicates if current window will receive mouse events when should not + // become activated. + bool wants_mouse_events_when_inactive_ = false; + DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostWin); }; diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index 11778fd..8c92b90 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h @@ -270,6 +270,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // If true then the widget uses software compositing. Defaults to false. // Only used on Windows. bool force_software_compositing; + + // Used if widget is not activatable to do determine if mouse events should + // be sent to the widget. + bool wants_mouse_events_when_inactive = false; }; Widget(); -- cgit v1.1