Chromium Code Reviews| Index: ui/views/widget/desktop_aura/x11_window_event_filter.cc |
| diff --git a/ui/views/widget/desktop_aura/x11_window_event_filter.cc b/ui/views/widget/desktop_aura/x11_window_event_filter.cc |
| index 9cb6834313d55bfa5f575810145ea3fa7b34c289..aec9d5d00c34b79846a90265a24fc315927e0747 100644 |
| --- a/ui/views/widget/desktop_aura/x11_window_event_filter.cc |
| +++ b/ui/views/widget/desktop_aura/x11_window_event_filter.cc |
| @@ -67,7 +67,8 @@ X11WindowEventFilter::X11WindowEventFilter( |
| x_root_window_(DefaultRootWindow(xdisplay_)), |
| atom_cache_(xdisplay_, kAtomsToCache), |
| window_tree_host_(window_tree_host), |
| - is_active_(false) { |
| + is_active_(false), |
| + mouse_target_component_(HTNOWHERE) { |
| } |
| X11WindowEventFilter::~X11WindowEventFilter() { |
| @@ -101,8 +102,10 @@ void X11WindowEventFilter::OnMouseEvent(ui::MouseEvent* event) { |
| if (!target->delegate()) |
| return; |
| + int previous_target_component = mouse_target_component_; |
| int component = |
| target->delegate()->GetNonClientComponent(event->location()); |
| + mouse_target_component_ = component; |
| if (component == HTCLIENT) |
| return; |
| @@ -115,10 +118,12 @@ void X11WindowEventFilter::OnMouseEvent(ui::MouseEvent* event) { |
| // Left button case. |
| if (event->flags() & ui::EF_IS_DOUBLE_CLICK && |
| component == HTCAPTION && |
| - target->GetProperty(aura::client::kCanMaximizeKey)) { |
| - // Our event is a double click in the caption area in a window that can be |
| - // maximized. We are responsible for dispatching this as a minimize/ |
| - // maximize on X11 (Windows converts this to min/max events for us). |
| + target->GetProperty(aura::client::kCanMaximizeKey) && |
| + previous_target_component == component) { |
|
varkha
2014/04/03 04:13:21
Should mouse_target_component_ variable be reset t
jonross
2014/04/07 15:49:30
Done.
|
| + // Our event is a double click, with both clicks in the caption area of a |
| + // window that can be maximized. We are responsible for dispatching this as |
| + // a minimize/maximize on X11 (Windows converts this to min/max events for |
|
varkha
2014/04/03 04:13:21
s/minimize/restore and s/min/restore?
jonross
2014/04/07 15:49:30
Done.
|
| + // us). |
| if (window_tree_host_->IsMaximized()) |
| window_tree_host_->Restore(); |
| else |