| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 // | 1136 // |
| 1137 // We can't do this later in the dispatch process because we share that | 1137 // We can't do this later in the dispatch process because we share that |
| 1138 // with ash, and ash gets confused about event IS_NON_CLIENT-ness on | 1138 // with ash, and ash gets confused about event IS_NON_CLIENT-ness on |
| 1139 // events, since ash doesn't expect this bit to be set, because it's never | 1139 // events, since ash doesn't expect this bit to be set, because it's never |
| 1140 // been set before. (This works on ash on Windows because none of the mouse | 1140 // been set before. (This works on ash on Windows because none of the mouse |
| 1141 // events on the ash desktop are clicking in what Windows considers to be a | 1141 // events on the ash desktop are clicking in what Windows considers to be a |
| 1142 // non client area.) Likewise, we won't want to do the following in any | 1142 // non client area.) Likewise, we won't want to do the following in any |
| 1143 // WindowTreeHost that hosts ash. | 1143 // WindowTreeHost that hosts ash. |
| 1144 if (content_window_ && content_window_->delegate()) { | 1144 if (content_window_ && content_window_->delegate()) { |
| 1145 int flags = event->flags(); | 1145 int flags = event->flags(); |
| 1146 int hit_test_code = | 1146 int hit_test_code = content_window_->delegate()->GetNonClientComponent( |
| 1147 content_window_->delegate()->GetNonClientComponent(event->location()); | 1147 gfx::ToFlooredPoint(event->location())); |
| 1148 if (hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE) | 1148 if (hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE) |
| 1149 flags |= ui::EF_IS_NON_CLIENT; | 1149 flags |= ui::EF_IS_NON_CLIENT; |
| 1150 event->set_flags(flags); | 1150 event->set_flags(flags); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 // While we unset the urgency hint when we gain focus, we also must remove it | 1153 // While we unset the urgency hint when we gain focus, we also must remove it |
| 1154 // on mouse clicks because we can call FlashFrame() on an active window. | 1154 // on mouse clicks because we can call FlashFrame() on an active window. |
| 1155 if (event->IsAnyButton() || event->IsMouseWheelEvent()) | 1155 if (event->IsAnyButton() || event->IsMouseWheelEvent()) |
| 1156 FlashFrame(false); | 1156 FlashFrame(false); |
| 1157 | 1157 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 if (linux_ui) { | 1612 if (linux_ui) { |
| 1613 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1613 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 1614 if (native_theme) | 1614 if (native_theme) |
| 1615 return native_theme; | 1615 return native_theme; |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 return ui::NativeTheme::instance(); | 1618 return ui::NativeTheme::instance(); |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 } // namespace views | 1621 } // namespace views |
| OLD | NEW |