| Index: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
|
| index 4271b8c1d5137ac9468521bdf7c94b7fee7deb69..54c07c301b54ade4952add3029a718fc84d35cfb 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
|
| @@ -52,15 +52,15 @@
|
|
|
| namespace views {
|
|
|
| -DesktopRootWindowHostX11* DesktopRootWindowHostX11::g_current_capture =
|
| +DesktopWindowTreeHostX11* DesktopWindowTreeHostX11::g_current_capture =
|
| NULL;
|
| -std::list<XID>* DesktopRootWindowHostX11::open_windows_ = NULL;
|
| +std::list<XID>* DesktopWindowTreeHostX11::open_windows_ = NULL;
|
|
|
| DEFINE_WINDOW_PROPERTY_KEY(
|
| aura::Window*, kViewsWindowForRootWindow, NULL);
|
|
|
| DEFINE_WINDOW_PROPERTY_KEY(
|
| - DesktopRootWindowHostX11*, kHostForRootWindow, NULL);
|
| + DesktopWindowTreeHostX11*, kHostForRootWindow, NULL);
|
|
|
| namespace {
|
|
|
| @@ -117,9 +117,9 @@ const char* kAtomsToCache[] = {
|
| } // namespace
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopRootWindowHostX11, public:
|
| +// DesktopWindowTreeHostX11, public:
|
|
|
| -DesktopRootWindowHostX11::DesktopRootWindowHostX11(
|
| +DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
|
| internal::NativeWidgetDelegate* native_widget_delegate,
|
| DesktopNativeWidgetAura* desktop_native_widget_aura)
|
| : close_widget_factory_(this),
|
| @@ -140,28 +140,28 @@ DesktopRootWindowHostX11::DesktopRootWindowHostX11(
|
| custom_window_shape_(NULL) {
|
| }
|
|
|
| -DesktopRootWindowHostX11::~DesktopRootWindowHostX11() {
|
| +DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
|
| root_window_->window()->ClearProperty(kHostForRootWindow);
|
| aura::client::SetWindowMoveClient(root_window_->window(), NULL);
|
| - desktop_native_widget_aura_->OnDesktopRootWindowHostDestroyed(root_window_);
|
| + desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(root_window_);
|
| if (custom_window_shape_)
|
| XDestroyRegion(custom_window_shape_);
|
| }
|
|
|
| // static
|
| -aura::Window* DesktopRootWindowHostX11::GetContentWindowForXID(XID xid) {
|
| +aura::Window* DesktopWindowTreeHostX11::GetContentWindowForXID(XID xid) {
|
| aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(xid);
|
| return root ? root->window()->GetProperty(kViewsWindowForRootWindow) : NULL;
|
| }
|
|
|
| // static
|
| -DesktopRootWindowHostX11* DesktopRootWindowHostX11::GetHostForXID(XID xid) {
|
| +DesktopWindowTreeHostX11* DesktopWindowTreeHostX11::GetHostForXID(XID xid) {
|
| aura::RootWindow* root = aura::RootWindow::GetForAcceleratedWidget(xid);
|
| return root ? root->window()->GetProperty(kHostForRootWindow) : NULL;
|
| }
|
|
|
| // static
|
| -std::vector<aura::Window*> DesktopRootWindowHostX11::GetAllOpenWindows() {
|
| +std::vector<aura::Window*> DesktopWindowTreeHostX11::GetAllOpenWindows() {
|
| std::vector<aura::Window*> windows(open_windows().size());
|
| std::transform(open_windows().begin(),
|
| open_windows().end(),
|
| @@ -170,11 +170,11 @@ std::vector<aura::Window*> DesktopRootWindowHostX11::GetAllOpenWindows() {
|
| return windows;
|
| }
|
|
|
| -gfx::Rect DesktopRootWindowHostX11::GetX11RootWindowBounds() const {
|
| +gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const {
|
| return bounds_;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::HandleNativeWidgetActivationChanged(
|
| +void DesktopWindowTreeHostX11::HandleNativeWidgetActivationChanged(
|
| bool active) {
|
| if (active) {
|
| delegate_->OnHostActivated();
|
| @@ -187,31 +187,31 @@ void DesktopRootWindowHostX11::HandleNativeWidgetActivationChanged(
|
| native_widget_delegate_->AsWidget()->GetRootView()->SchedulePaint();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::AddObserver(
|
| - views::DesktopRootWindowHostObserverX11* observer) {
|
| +void DesktopWindowTreeHostX11::AddObserver(
|
| + views::DesktopWindowTreeHostObserverX11* observer) {
|
| observer_list_.AddObserver(observer);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::RemoveObserver(
|
| - views::DesktopRootWindowHostObserverX11* observer) {
|
| +void DesktopWindowTreeHostX11::RemoveObserver(
|
| + views::DesktopWindowTreeHostObserverX11* observer) {
|
| observer_list_.RemoveObserver(observer);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::CleanUpWindowList() {
|
| +void DesktopWindowTreeHostX11::CleanUpWindowList() {
|
| delete open_windows_;
|
| open_windows_ = NULL;
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopRootWindowHostX11, DesktopRootWindowHost implementation:
|
| +// DesktopWindowTreeHostX11, DesktopWindowTreeHost implementation:
|
|
|
| -void DesktopRootWindowHostX11::Init(
|
| +void DesktopWindowTreeHostX11::Init(
|
| aura::Window* content_window,
|
| const Widget::InitParams& params,
|
| aura::RootWindow::CreateParams* rw_create_params) {
|
| content_window_ = content_window;
|
|
|
| - // TODO(erg): Check whether we *should* be building a RootWindowHost here, or
|
| + // TODO(erg): Check whether we *should* be building a WindowTreeHost here, or
|
| // whether we should be proxying requests to another DRWHL.
|
|
|
| // In some situations, views tries to make a zero sized window, and that
|
| @@ -228,7 +228,7 @@ void DesktopRootWindowHostX11::Init(
|
| rw_create_params->host = this;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnRootWindowCreated(
|
| +void DesktopWindowTreeHostX11::OnRootWindowCreated(
|
| aura::RootWindow* root,
|
| const Widget::InitParams& params) {
|
| root_window_ = root;
|
| @@ -261,20 +261,20 @@ void DesktopRootWindowHostX11::OnRootWindowCreated(
|
| native_widget_delegate_->OnNativeWidgetCreated(true);
|
| }
|
|
|
| -scoped_ptr<corewm::Tooltip> DesktopRootWindowHostX11::CreateTooltip() {
|
| +scoped_ptr<corewm::Tooltip> DesktopWindowTreeHostX11::CreateTooltip() {
|
| return scoped_ptr<corewm::Tooltip>(
|
| new corewm::TooltipAura(gfx::SCREEN_TYPE_NATIVE));
|
| }
|
|
|
| scoped_ptr<aura::client::DragDropClient>
|
| -DesktopRootWindowHostX11::CreateDragDropClient(
|
| +DesktopWindowTreeHostX11::CreateDragDropClient(
|
| DesktopNativeCursorManager* cursor_manager) {
|
| drag_drop_client_ = new DesktopDragDropClientAuraX11(
|
| root_window_->window(), cursor_manager, xdisplay_, xwindow_);
|
| return scoped_ptr<aura::client::DragDropClient>(drag_drop_client_).Pass();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Close() {
|
| +void DesktopWindowTreeHostX11::Close() {
|
| // TODO(erg): Might need to do additional hiding tasks here.
|
|
|
| if (!close_widget_factory_.HasWeakPtrs()) {
|
| @@ -284,12 +284,12 @@ void DesktopRootWindowHostX11::Close() {
|
| // dereference us when the callback returns).
|
| base::MessageLoop::current()->PostTask(
|
| FROM_HERE,
|
| - base::Bind(&DesktopRootWindowHostX11::CloseNow,
|
| + base::Bind(&DesktopWindowTreeHostX11::CloseNow,
|
| close_widget_factory_.GetWeakPtr()));
|
| }
|
| }
|
|
|
| -void DesktopRootWindowHostX11::CloseNow() {
|
| +void DesktopWindowTreeHostX11::CloseNow() {
|
| if (xwindow_ == None)
|
| return;
|
|
|
| @@ -298,8 +298,8 @@ void DesktopRootWindowHostX11::CloseNow() {
|
|
|
| // If we have children, close them. Use a copy for iteration because they'll
|
| // remove themselves.
|
| - std::set<DesktopRootWindowHostX11*> window_children_copy = window_children_;
|
| - for (std::set<DesktopRootWindowHostX11*>::iterator it =
|
| + std::set<DesktopWindowTreeHostX11*> window_children_copy = window_children_;
|
| + for (std::set<DesktopWindowTreeHostX11*>::iterator it =
|
| window_children_copy.begin(); it != window_children_copy.end();
|
| ++it) {
|
| (*it)->CloseNow();
|
| @@ -326,11 +326,11 @@ void DesktopRootWindowHostX11::CloseNow() {
|
| desktop_native_widget_aura_->OnHostClosed();
|
| }
|
|
|
| -aura::RootWindowHost* DesktopRootWindowHostX11::AsRootWindowHost() {
|
| +aura::WindowTreeHost* DesktopWindowTreeHostX11::AsWindowTreeHost() {
|
| return this;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::ShowWindowWithState(
|
| +void DesktopWindowTreeHostX11::ShowWindowWithState(
|
| ui::WindowShowState show_state) {
|
| if (show_state != ui::SHOW_STATE_DEFAULT &&
|
| show_state != ui::SHOW_STATE_NORMAL) {
|
| @@ -341,27 +341,27 @@ void DesktopRootWindowHostX11::ShowWindowWithState(
|
| Show();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::ShowMaximizedWithBounds(
|
| +void DesktopWindowTreeHostX11::ShowMaximizedWithBounds(
|
| const gfx::Rect& restored_bounds) {
|
| restored_bounds_ = restored_bounds;
|
| Maximize();
|
| Show();
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsVisible() const {
|
| +bool DesktopWindowTreeHostX11::IsVisible() const {
|
| return window_mapped_;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetSize(const gfx::Size& size) {
|
| +void DesktopWindowTreeHostX11::SetSize(const gfx::Size& size) {
|
| // TODO(erg):
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::StackAtTop() {
|
| +void DesktopWindowTreeHostX11::StackAtTop() {
|
| XRaiseWindow(xdisplay_, xwindow_);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::CenterWindow(const gfx::Size& size) {
|
| +void DesktopWindowTreeHostX11::CenterWindow(const gfx::Size& size) {
|
| gfx::Rect parent_bounds = GetWorkAreaBoundsInScreen();
|
|
|
| // If |window_|'s transient parent bounds are big enough to contain |size|,
|
| @@ -387,7 +387,7 @@ void DesktopRootWindowHostX11::CenterWindow(const gfx::Size& size) {
|
| SetBounds(window_bounds);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::GetWindowPlacement(
|
| +void DesktopWindowTreeHostX11::GetWindowPlacement(
|
| gfx::Rect* bounds,
|
| ui::WindowShowState* show_state) const {
|
| *bounds = bounds_;
|
| @@ -405,14 +405,14 @@ void DesktopRootWindowHostX11::GetWindowPlacement(
|
| }
|
| }
|
|
|
| -gfx::Rect DesktopRootWindowHostX11::GetWindowBoundsInScreen() const {
|
| +gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
|
| return bounds_;
|
| }
|
|
|
| -gfx::Rect DesktopRootWindowHostX11::GetClientAreaBoundsInScreen() const {
|
| +gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
|
| // TODO(erg): The NativeWidgetAura version returns |bounds_|, claiming its
|
| // needed for View::ConvertPointToScreen() to work
|
| - // correctly. DesktopRootWindowHostWin::GetClientAreaBoundsInScreen() just
|
| + // correctly. DesktopWindowTreeHostWin::GetClientAreaBoundsInScreen() just
|
| // asks windows what it thinks the client rect is.
|
| //
|
| // Attempts to calculate the rect by asking the NonClientFrameView what it
|
| @@ -421,7 +421,7 @@ gfx::Rect DesktopRootWindowHostX11::GetClientAreaBoundsInScreen() const {
|
| return bounds_;
|
| }
|
|
|
| -gfx::Rect DesktopRootWindowHostX11::GetRestoredBounds() const {
|
| +gfx::Rect DesktopWindowTreeHostX11::GetRestoredBounds() const {
|
| // We can't reliably track the restored bounds of a window, but we can get
|
| // the 90% case down. When *chrome* is the process that requests maximizing
|
| // or restoring bounds, we can record the current bounds before we request
|
| @@ -432,7 +432,7 @@ gfx::Rect DesktopRootWindowHostX11::GetRestoredBounds() const {
|
| return GetWindowBoundsInScreen();
|
| }
|
|
|
| -gfx::Rect DesktopRootWindowHostX11::GetWorkAreaBoundsInScreen() const {
|
| +gfx::Rect DesktopWindowTreeHostX11::GetWorkAreaBoundsInScreen() const {
|
| std::vector<int> value;
|
| if (ui::GetIntArrayProperty(x_root_window_, "_NET_WORKAREA", &value) &&
|
| value.size() >= 4) {
|
| @@ -453,7 +453,7 @@ gfx::Rect DesktopRootWindowHostX11::GetWorkAreaBoundsInScreen() const {
|
| return gfx::Rect(x, y, width, height);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetShape(gfx::NativeRegion native_region) {
|
| +void DesktopWindowTreeHostX11::SetShape(gfx::NativeRegion native_region) {
|
| if (custom_window_shape_)
|
| XDestroyRegion(custom_window_shape_);
|
| custom_window_shape_ = gfx::CreateRegionFromSkRegion(*native_region);
|
| @@ -461,22 +461,22 @@ void DesktopRootWindowHostX11::SetShape(gfx::NativeRegion native_region) {
|
| delete native_region;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Activate() {
|
| +void DesktopWindowTreeHostX11::Activate() {
|
| X11DesktopHandler::get()->ActivateWindow(xwindow_);
|
| native_widget_delegate_->AsWidget()->SetInitialFocus();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Deactivate() {
|
| +void DesktopWindowTreeHostX11::Deactivate() {
|
| // Deactivating a window means activating nothing.
|
| x11_capture_.reset();
|
| X11DesktopHandler::get()->ActivateWindow(None);
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsActive() const {
|
| +bool DesktopWindowTreeHostX11::IsActive() const {
|
| return X11DesktopHandler::get()->IsActiveWindow(xwindow_);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Maximize() {
|
| +void DesktopWindowTreeHostX11::Maximize() {
|
| // When we're the process requesting the maximizing, we can accurately keep
|
| // track of our restored bounds instead of relying on the heuristics that are
|
| // in the PropertyNotify and ConfigureNotify handlers.
|
| @@ -487,43 +487,43 @@ void DesktopRootWindowHostX11::Maximize() {
|
| atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ"));
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Minimize() {
|
| +void DesktopWindowTreeHostX11::Minimize() {
|
| x11_capture_.reset();
|
| XIconifyWindow(xdisplay_, xwindow_, 0);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Restore() {
|
| +void DesktopWindowTreeHostX11::Restore() {
|
| SetWMSpecState(false,
|
| atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"),
|
| atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ"));
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsMaximized() const {
|
| +bool DesktopWindowTreeHostX11::IsMaximized() const {
|
| return (HasWMSpecProperty("_NET_WM_STATE_MAXIMIZED_VERT") &&
|
| HasWMSpecProperty("_NET_WM_STATE_MAXIMIZED_HORZ"));
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsMinimized() const {
|
| +bool DesktopWindowTreeHostX11::IsMinimized() const {
|
| return HasWMSpecProperty("_NET_WM_STATE_HIDDEN");
|
| }
|
|
|
|
|
| -bool DesktopRootWindowHostX11::HasCapture() const {
|
| +bool DesktopWindowTreeHostX11::HasCapture() const {
|
| return g_current_capture == this;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetAlwaysOnTop(bool always_on_top) {
|
| +void DesktopWindowTreeHostX11::SetAlwaysOnTop(bool always_on_top) {
|
| is_always_on_top_ = always_on_top;
|
| SetWMSpecState(always_on_top,
|
| atom_cache_.GetAtom("_NET_WM_STATE_ABOVE"),
|
| None);
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsAlwaysOnTop() const {
|
| +bool DesktopWindowTreeHostX11::IsAlwaysOnTop() const {
|
| return is_always_on_top_;
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::SetWindowTitle(const base::string16& title) {
|
| +bool DesktopWindowTreeHostX11::SetWindowTitle(const base::string16& title) {
|
| if (window_title_ == title)
|
| return false;
|
| window_title_ = title;
|
| @@ -544,7 +544,7 @@ bool DesktopRootWindowHostX11::SetWindowTitle(const base::string16& title) {
|
| return true;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::ClearNativeFocus() {
|
| +void DesktopWindowTreeHostX11::ClearNativeFocus() {
|
| // This method is weird and misnamed. Instead of clearing the native focus,
|
| // it sets the focus to our |content_window_|, which will trigger a cascade
|
| // of focus changes into views.
|
| @@ -555,7 +555,7 @@ void DesktopRootWindowHostX11::ClearNativeFocus() {
|
| }
|
| }
|
|
|
| -Widget::MoveLoopResult DesktopRootWindowHostX11::RunMoveLoop(
|
| +Widget::MoveLoopResult DesktopWindowTreeHostX11::RunMoveLoop(
|
| const gfx::Vector2d& drag_offset,
|
| Widget::MoveLoopSource source,
|
| Widget::MoveLoopEscapeBehavior escape_behavior) {
|
| @@ -570,42 +570,42 @@ Widget::MoveLoopResult DesktopRootWindowHostX11::RunMoveLoop(
|
| return Widget::MOVE_LOOP_CANCELED;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::EndMoveLoop() {
|
| +void DesktopWindowTreeHostX11::EndMoveLoop() {
|
| x11_window_move_client_->EndMoveLoop();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetVisibilityChangedAnimationsEnabled(
|
| +void DesktopWindowTreeHostX11::SetVisibilityChangedAnimationsEnabled(
|
| bool value) {
|
| // Much like the previous NativeWidgetGtk, we don't have anything to do here.
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::ShouldUseNativeFrame() {
|
| +bool DesktopWindowTreeHostX11::ShouldUseNativeFrame() {
|
| return false;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::FrameTypeChanged() {
|
| +void DesktopWindowTreeHostX11::FrameTypeChanged() {
|
| // Replace the frame and layout the contents. Even though we don't have a
|
| // swapable glass frame like on Windows, we still replace the frame because
|
| // the button assets don't update otherwise.
|
| native_widget_delegate_->AsWidget()->non_client_view()->UpdateFrame();
|
| }
|
|
|
| -NonClientFrameView* DesktopRootWindowHostX11::CreateNonClientFrameView() {
|
| +NonClientFrameView* DesktopWindowTreeHostX11::CreateNonClientFrameView() {
|
| return NULL;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetFullscreen(bool fullscreen) {
|
| +void DesktopWindowTreeHostX11::SetFullscreen(bool fullscreen) {
|
| is_fullscreen_ = fullscreen;
|
| SetWMSpecState(fullscreen,
|
| atom_cache_.GetAtom("_NET_WM_STATE_FULLSCREEN"),
|
| None);
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsFullscreen() const {
|
| +bool DesktopWindowTreeHostX11::IsFullscreen() const {
|
| return is_fullscreen_;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetOpacity(unsigned char opacity) {
|
| +void DesktopWindowTreeHostX11::SetOpacity(unsigned char opacity) {
|
| // X server opacity is in terms of 32 bit unsigned int space, and counts from
|
| // the opposite direction.
|
| // XChangeProperty() expects "cardinality" to be long.
|
| @@ -623,7 +623,7 @@ void DesktopRootWindowHostX11::SetOpacity(unsigned char opacity) {
|
| }
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetWindowIcons(
|
| +void DesktopWindowTreeHostX11::SetWindowIcons(
|
| const gfx::ImageSkia& window_icon, const gfx::ImageSkia& app_icon) {
|
| // TODO(erg): The way we handle icons across different versions of chrome
|
| // could be substantially improved. The Windows version does its own thing
|
| @@ -647,7 +647,7 @@ void DesktopRootWindowHostX11::SetWindowIcons(
|
| ui::SetAtomArrayProperty(xwindow_, "_NET_WM_ICON", "CARDINAL", data);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::InitModalType(ui::ModalType modal_type) {
|
| +void DesktopWindowTreeHostX11::InitModalType(ui::ModalType modal_type) {
|
| switch (modal_type) {
|
| case ui::MODAL_TYPE_NONE:
|
| break;
|
| @@ -659,12 +659,12 @@ void DesktopRootWindowHostX11::InitModalType(ui::ModalType modal_type) {
|
| }
|
| }
|
|
|
| -void DesktopRootWindowHostX11::FlashFrame(bool flash_frame) {
|
| +void DesktopWindowTreeHostX11::FlashFrame(bool flash_frame) {
|
| // TODO(erg):
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnRootViewLayout() const {
|
| +void DesktopWindowTreeHostX11::OnRootViewLayout() const {
|
| if (!window_mapped_)
|
| return;
|
|
|
| @@ -693,33 +693,33 @@ void DesktopRootWindowHostX11::OnRootViewLayout() const {
|
| XSetWMNormalHints(xdisplay_, xwindow_, &hints);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnNativeWidgetFocus() {
|
| +void DesktopWindowTreeHostX11::OnNativeWidgetFocus() {
|
| native_widget_delegate_->AsWidget()->GetInputMethod()->OnFocus();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnNativeWidgetBlur() {
|
| +void DesktopWindowTreeHostX11::OnNativeWidgetBlur() {
|
| if (xwindow_) {
|
| x11_capture_.reset();
|
| native_widget_delegate_->AsWidget()->GetInputMethod()->OnBlur();
|
| }
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsAnimatingClosed() const {
|
| +bool DesktopWindowTreeHostX11::IsAnimatingClosed() const {
|
| return false;
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopRootWindowHostX11, aura::RootWindowHost implementation:
|
| +// DesktopWindowTreeHostX11, aura::WindowTreeHost implementation:
|
|
|
| -aura::RootWindow* DesktopRootWindowHostX11::GetRootWindow() {
|
| +aura::RootWindow* DesktopWindowTreeHostX11::GetRootWindow() {
|
| return root_window_;
|
| }
|
|
|
| -gfx::AcceleratedWidget DesktopRootWindowHostX11::GetAcceleratedWidget() {
|
| +gfx::AcceleratedWidget DesktopWindowTreeHostX11::GetAcceleratedWidget() {
|
| return xwindow_;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Show() {
|
| +void DesktopWindowTreeHostX11::Show() {
|
| if (!window_mapped_) {
|
| // Before we map the window, set size hints. Otherwise, some window managers
|
| // will ignore toplevel XMoveWindow commands.
|
| @@ -741,22 +741,22 @@ void DesktopRootWindowHostX11::Show() {
|
| native_widget_delegate_->AsWidget()->SetInitialFocus();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::Hide() {
|
| +void DesktopWindowTreeHostX11::Hide() {
|
| if (window_mapped_) {
|
| XWithdrawWindow(xdisplay_, xwindow_, 0);
|
| window_mapped_ = false;
|
| }
|
| }
|
|
|
| -void DesktopRootWindowHostX11::ToggleFullScreen() {
|
| +void DesktopWindowTreeHostX11::ToggleFullScreen() {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| -gfx::Rect DesktopRootWindowHostX11::GetBounds() const {
|
| +gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
|
| return bounds_;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetBounds(const gfx::Rect& bounds) {
|
| +void DesktopWindowTreeHostX11::SetBounds(const gfx::Rect& bounds) {
|
| bool origin_changed = bounds_.origin() != bounds.origin();
|
| bool size_changed = bounds_.size() != bounds.size();
|
| XWindowChanges changes = {0};
|
| @@ -795,18 +795,18 @@ void DesktopRootWindowHostX11::SetBounds(const gfx::Rect& bounds) {
|
| compositor()->ScheduleRedrawRect(gfx::Rect(bounds.size()));
|
| }
|
|
|
| -gfx::Insets DesktopRootWindowHostX11::GetInsets() const {
|
| +gfx::Insets DesktopWindowTreeHostX11::GetInsets() const {
|
| return gfx::Insets();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetInsets(const gfx::Insets& insets) {
|
| +void DesktopWindowTreeHostX11::SetInsets(const gfx::Insets& insets) {
|
| }
|
|
|
| -gfx::Point DesktopRootWindowHostX11::GetLocationOnNativeScreen() const {
|
| +gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
|
| return bounds_.origin();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetCapture() {
|
| +void DesktopWindowTreeHostX11::SetCapture() {
|
| // This is vaguely based on the old NativeWidgetGtk implementation.
|
| //
|
| // X11's XPointerGrab() shouldn't be used for everything; it doesn't map
|
| @@ -822,16 +822,16 @@ void DesktopRootWindowHostX11::SetCapture() {
|
| x11_capture_.reset(new X11ScopedCapture(xwindow_));
|
| }
|
|
|
| -void DesktopRootWindowHostX11::ReleaseCapture() {
|
| +void DesktopWindowTreeHostX11::ReleaseCapture() {
|
| if (g_current_capture == this)
|
| g_current_capture->OnCaptureReleased();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetCursor(gfx::NativeCursor cursor) {
|
| +void DesktopWindowTreeHostX11::SetCursor(gfx::NativeCursor cursor) {
|
| XDefineCursor(xdisplay_, xwindow_, cursor.platform());
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::QueryMouseLocation(
|
| +bool DesktopWindowTreeHostX11::QueryMouseLocation(
|
| gfx::Point* location_return) {
|
| aura::client::CursorClient* cursor_client =
|
| aura::client::GetCursorClient(GetRootWindow()->window());
|
| @@ -857,26 +857,26 @@ bool DesktopRootWindowHostX11::QueryMouseLocation(
|
| win_y_return >= 0 && win_y_return < bounds_.height());
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::ConfineCursorToRootWindow() {
|
| +bool DesktopWindowTreeHostX11::ConfineCursorToRootWindow() {
|
| NOTIMPLEMENTED();
|
| return false;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::UnConfineCursor() {
|
| +void DesktopWindowTreeHostX11::UnConfineCursor() {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnCursorVisibilityChanged(bool show) {
|
| +void DesktopWindowTreeHostX11::OnCursorVisibilityChanged(bool show) {
|
| // TODO(erg): Conditional on us enabling touch on desktop linux builds, do
|
| // the same tap-to-click disabling here that chromeos does.
|
| }
|
|
|
| -void DesktopRootWindowHostX11::MoveCursorTo(const gfx::Point& location) {
|
| +void DesktopWindowTreeHostX11::MoveCursorTo(const gfx::Point& location) {
|
| XWarpPointer(xdisplay_, None, x_root_window_, 0, 0, 0, 0,
|
| bounds_.x() + location.x(), bounds_.y() + location.y());
|
| }
|
|
|
| -void DesktopRootWindowHostX11::PostNativeEvent(
|
| +void DesktopWindowTreeHostX11::PostNativeEvent(
|
| const base::NativeEvent& native_event) {
|
| DCHECK(xwindow_);
|
| DCHECK(xdisplay_);
|
| @@ -909,17 +909,17 @@ void DesktopRootWindowHostX11::PostNativeEvent(
|
| XSendEvent(xdisplay_, xwindow_, False, 0, &xevent);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnDeviceScaleFactorChanged(
|
| +void DesktopWindowTreeHostX11::OnDeviceScaleFactorChanged(
|
| float device_scale_factor) {
|
| }
|
|
|
| -void DesktopRootWindowHostX11::PrepareForShutdown() {
|
| +void DesktopWindowTreeHostX11::PrepareForShutdown() {
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopRootWindowHostX11, private:
|
| +// DesktopWindowTreeHostX11, private:
|
|
|
| -void DesktopRootWindowHostX11::InitX11Window(
|
| +void DesktopWindowTreeHostX11::InitX11Window(
|
| const Widget::InitParams& params) {
|
| unsigned long attribute_mask = CWBackPixmap;
|
| XSetWindowAttributes swa;
|
| @@ -1069,14 +1069,14 @@ void DesktopRootWindowHostX11::InitX11Window(
|
| CreateCompositor(GetAcceleratedWidget());
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::IsWindowManagerPresent() {
|
| +bool DesktopWindowTreeHostX11::IsWindowManagerPresent() {
|
| // Per ICCCM 2.8, "Manager Selections", window managers should take ownership
|
| // of WM_Sn selections (where n is a screen number).
|
| return XGetSelectionOwner(
|
| xdisplay_, atom_cache_.GetAtom("WM_S0")) != None;
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SetWMSpecState(bool enabled,
|
| +void DesktopWindowTreeHostX11::SetWMSpecState(bool enabled,
|
| ::Atom state1,
|
| ::Atom state2) {
|
| XEvent xclient;
|
| @@ -1097,23 +1097,23 @@ void DesktopRootWindowHostX11::SetWMSpecState(bool enabled,
|
| &xclient);
|
| }
|
|
|
| -bool DesktopRootWindowHostX11::HasWMSpecProperty(const char* property) const {
|
| +bool DesktopWindowTreeHostX11::HasWMSpecProperty(const char* property) const {
|
| return window_properties_.find(atom_cache_.GetAtom(property)) !=
|
| window_properties_.end();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::OnCaptureReleased() {
|
| +void DesktopWindowTreeHostX11::OnCaptureReleased() {
|
| x11_capture_.reset();
|
| g_current_capture = NULL;
|
| delegate_->OnHostLostWindowCapture();
|
| native_widget_delegate_->OnMouseCaptureLost();
|
| }
|
|
|
| -void DesktopRootWindowHostX11::DispatchMouseEvent(ui::MouseEvent* event) {
|
| +void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) {
|
| if (!g_current_capture || g_current_capture == this) {
|
| delegate_->OnHostMouseEvent(event);
|
| } else {
|
| - // Another DesktopRootWindowHostX11 has installed itself as
|
| + // Another DesktopWindowTreeHostX11 has installed itself as
|
| // capture. Translate the event's location and dispatch to the other.
|
| event->ConvertLocationToTarget(root_window_->window(),
|
| g_current_capture->root_window_->window());
|
| @@ -1121,7 +1121,7 @@ void DesktopRootWindowHostX11::DispatchMouseEvent(ui::MouseEvent* event) {
|
| }
|
| }
|
|
|
| -void DesktopRootWindowHostX11::DispatchTouchEvent(ui::TouchEvent* event) {
|
| +void DesktopWindowTreeHostX11::DispatchTouchEvent(ui::TouchEvent* event) {
|
| if (g_current_capture && g_current_capture != this &&
|
| event->type() == ui::ET_TOUCH_PRESSED) {
|
| event->ConvertLocationToTarget(root_window_->window(),
|
| @@ -1132,7 +1132,7 @@ void DesktopRootWindowHostX11::DispatchTouchEvent(ui::TouchEvent* event) {
|
| }
|
| }
|
|
|
| -void DesktopRootWindowHostX11::ResetWindowRegion() {
|
| +void DesktopWindowTreeHostX11::ResetWindowRegion() {
|
| // If a custom window shape was supplied then apply it.
|
| if (custom_window_shape_) {
|
| XShapeCombineRegion(
|
| @@ -1165,7 +1165,7 @@ void DesktopRootWindowHostX11::ResetWindowRegion() {
|
| 0, 0, &r, 1, ShapeSet, YXBanded);
|
| }
|
|
|
| -void DesktopRootWindowHostX11::SerializeImageRepresentation(
|
| +void DesktopWindowTreeHostX11::SerializeImageRepresentation(
|
| const gfx::ImageSkiaRep& rep,
|
| std::vector<unsigned long>* data) {
|
| int width = rep.GetWidth();
|
| @@ -1182,19 +1182,19 @@ void DesktopRootWindowHostX11::SerializeImageRepresentation(
|
| data->push_back(bitmap.getColor(x, y));
|
| }
|
|
|
| -std::list<XID>& DesktopRootWindowHostX11::open_windows() {
|
| +std::list<XID>& DesktopWindowTreeHostX11::open_windows() {
|
| if (!open_windows_)
|
| open_windows_ = new std::list<XID>();
|
| return *open_windows_;
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopRootWindowHostX11, MessageLoop::Dispatcher implementation:
|
| +// DesktopWindowTreeHostX11, MessageLoop::Dispatcher implementation:
|
|
|
| -bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) {
|
| +bool DesktopWindowTreeHostX11::Dispatch(const base::NativeEvent& event) {
|
| XEvent* xev = event;
|
|
|
| - TRACE_EVENT1("views", "DesktopRootWindowHostX11::Dispatch",
|
| + TRACE_EVENT1("views", "DesktopWindowTreeHostX11::Dispatch",
|
| "event->type", event->type);
|
|
|
| // May want to factor CheckXEventForConsistency(xev); into a common location
|
| @@ -1384,13 +1384,13 @@ bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) {
|
| break;
|
| }
|
| case MapNotify: {
|
| - FOR_EACH_OBSERVER(DesktopRootWindowHostObserverX11,
|
| + FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
|
| observer_list_,
|
| OnWindowMapped(xwindow_));
|
| break;
|
| }
|
| case UnmapNotify: {
|
| - FOR_EACH_OBSERVER(DesktopRootWindowHostObserverX11,
|
| + FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11,
|
| observer_list_,
|
| OnWindowUnmapped(xwindow_));
|
| break;
|
| @@ -1401,7 +1401,7 @@ bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) {
|
| Atom protocol = static_cast<Atom>(xev->xclient.data.l[0]);
|
| if (protocol == atom_cache_.GetAtom("WM_DELETE_WINDOW")) {
|
| // We have received a close message from the window manager.
|
| - root_window_->OnRootWindowHostCloseRequested();
|
| + root_window_->OnWindowTreeHostCloseRequested();
|
| } else if (protocol == atom_cache_.GetAtom("_NET_WM_PING")) {
|
| XEvent reply_event = *xev;
|
| reply_event.xclient.window = x_root_window_;
|
| @@ -1524,18 +1524,18 @@ bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) {
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopRootWindowHost, public:
|
| +// DesktopWindowTreeHost, public:
|
|
|
| // static
|
| -DesktopRootWindowHost* DesktopRootWindowHost::Create(
|
| +DesktopWindowTreeHost* DesktopWindowTreeHost::Create(
|
| internal::NativeWidgetDelegate* native_widget_delegate,
|
| DesktopNativeWidgetAura* desktop_native_widget_aura) {
|
| - return new DesktopRootWindowHostX11(native_widget_delegate,
|
| + return new DesktopWindowTreeHostX11(native_widget_delegate,
|
| desktop_native_widget_aura);
|
| }
|
|
|
| // static
|
| -ui::NativeTheme* DesktopRootWindowHost::GetNativeTheme(aura::Window* window) {
|
| +ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) {
|
| const views::LinuxUI* linux_ui = views::LinuxUI::instance();
|
| if (linux_ui) {
|
| ui::NativeTheme* native_theme = linux_ui->GetNativeTheme();
|
|
|