| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void DesktopWindowTreeHostX11::OnRootWindowCreated( | 232 void DesktopWindowTreeHostX11::OnRootWindowCreated( |
| 233 aura::WindowEventDispatcher* dispatcher, | 233 aura::WindowEventDispatcher* dispatcher, |
| 234 const Widget::InitParams& params) { | 234 const Widget::InitParams& params) { |
| 235 dispatcher_ = dispatcher; | 235 dispatcher_ = dispatcher; |
| 236 | 236 |
| 237 dispatcher_->window()->SetProperty(kViewsWindowForRootWindow, | 237 dispatcher_->window()->SetProperty(kViewsWindowForRootWindow, |
| 238 content_window_); | 238 content_window_); |
| 239 dispatcher_->window()->SetProperty(kHostForRootWindow, this); | 239 dispatcher_->window()->SetProperty(kHostForRootWindow, this); |
| 240 delegate_ = dispatcher_; | 240 delegate_ = dispatcher_; |
| 241 | 241 |
| 242 // If we're given a parent, we need to mark ourselves as transient to another | |
| 243 // window. Otherwise activation gets screwy. | |
| 244 gfx::NativeView parent = params.parent; | |
| 245 if (!params.child && params.parent) { | |
| 246 corewm::AddTransientChild(parent, content_window_); | |
| 247 } | |
| 248 | |
| 249 // Ensure that the X11DesktopHandler exists so that it dispatches activation | 242 // Ensure that the X11DesktopHandler exists so that it dispatches activation |
| 250 // messages to us. | 243 // messages to us. |
| 251 X11DesktopHandler::get(); | 244 X11DesktopHandler::get(); |
| 252 | 245 |
| 253 // TODO(erg): Unify this code once the other consumer goes away. | 246 // TODO(erg): Unify this code once the other consumer goes away. |
| 254 x11_window_event_filter_.reset(new X11WindowEventFilter(dispatcher_, this)); | 247 x11_window_event_filter_.reset(new X11WindowEventFilter(dispatcher_, this)); |
| 255 SetUseNativeFrame(params.type == Widget::InitParams::TYPE_WINDOW && | 248 SetUseNativeFrame(params.type == Widget::InitParams::TYPE_WINDOW && |
| 256 !params.remove_standard_frame); | 249 !params.remove_standard_frame); |
| 257 desktop_native_widget_aura_->root_window_event_filter()->AddHandler( | 250 desktop_native_widget_aura_->root_window_event_filter()->AddHandler( |
| 258 x11_window_event_filter_.get()); | 251 x11_window_event_filter_.get()); |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 if (linux_ui) { | 1621 if (linux_ui) { |
| 1629 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); | 1622 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); |
| 1630 if (native_theme) | 1623 if (native_theme) |
| 1631 return native_theme; | 1624 return native_theme; |
| 1632 } | 1625 } |
| 1633 | 1626 |
| 1634 return ui::NativeTheme::instance(); | 1627 return ui::NativeTheme::instance(); |
| 1635 } | 1628 } |
| 1636 | 1629 |
| 1637 } // namespace views | 1630 } // namespace views |
| OLD | NEW |