| 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_root_window_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 open_windows().end(), | 153 open_windows().end(), |
| 154 windows.begin(), | 154 windows.begin(), |
| 155 GetContentWindowForXID); | 155 GetContentWindowForXID); |
| 156 return windows; | 156 return windows; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void DesktopRootWindowHostX11::HandleNativeWidgetActivationChanged( | 159 void DesktopRootWindowHostX11::HandleNativeWidgetActivationChanged( |
| 160 bool active) { | 160 bool active) { |
| 161 if (active) | 161 if (active) |
| 162 root_window_host_delegate_->OnHostActivated(); | 162 root_window_host_delegate_->OnHostActivated(); |
| 163 native_widget_delegate_->OnNativeWidgetActivationChanged(active); | 163 |
| 164 // If we're not active we need to deactivate the corresponding aura::Window. | 164 desktop_native_widget_aura_->HandleActivationChanged(active); |
| 165 // This way if a child widget is active it gets correctly deactivated (child | |
| 166 // widgets don't get native desktop activation changes, only aura activation | |
| 167 // changes). | |
| 168 if (!active) { | |
| 169 aura::client::ActivationClient* activation_client = | |
| 170 aura::client::GetActivationClient(root_window_); | |
| 171 if (activation_client) { | |
| 172 aura::Window* active_window = activation_client->GetActiveWindow(); | |
| 173 if (active_window) | |
| 174 activation_client->DeactivateWindow(active_window); | |
| 175 } | |
| 176 } | |
| 177 | 165 |
| 178 native_widget_delegate_->AsWidget()->GetRootView()->SchedulePaint(); | 166 native_widget_delegate_->AsWidget()->GetRootView()->SchedulePaint(); |
| 179 } | 167 } |
| 180 | 168 |
| 181 void DesktopRootWindowHostX11::AddObserver( | 169 void DesktopRootWindowHostX11::AddObserver( |
| 182 views::DesktopRootWindowHostObserverX11* observer) { | 170 views::DesktopRootWindowHostObserverX11* observer) { |
| 183 observer_list_.AddObserver(observer); | 171 observer_list_.AddObserver(observer); |
| 184 } | 172 } |
| 185 | 173 |
| 186 void DesktopRootWindowHostX11::RemoveObserver( | 174 void DesktopRootWindowHostX11::RemoveObserver( |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 if (linux_ui) { | 1336 if (linux_ui) { |
| 1349 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); | 1337 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); |
| 1350 if (native_theme) | 1338 if (native_theme) |
| 1351 return native_theme; | 1339 return native_theme; |
| 1352 } | 1340 } |
| 1353 | 1341 |
| 1354 return ui::NativeTheme::instance(); | 1342 return ui::NativeTheme::instance(); |
| 1355 } | 1343 } |
| 1356 | 1344 |
| 1357 } // namespace views | 1345 } // namespace views |
| OLD | NEW |