| Index: ui/aura/window_tree_host_x11.cc
|
| diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
|
| index 3d4d3b92b22d9cdf702ac313618cf02c0d719a18..8915790ff6a93e15d1c9565d70b706b685a622b7 100644
|
| --- a/ui/aura/window_tree_host_x11.cc
|
| +++ b/ui/aura/window_tree_host_x11.cc
|
| @@ -35,6 +35,7 @@
|
| #include "ui/base/ui_base_switches.h"
|
| #include "ui/base/view_prop.h"
|
| #include "ui/base/x/x11_util.h"
|
| +#include "ui/compositor/compositor.h"
|
| #include "ui/compositor/dip_util.h"
|
| #include "ui/compositor/layer.h"
|
| #include "ui/events/event.h"
|
| @@ -418,7 +419,7 @@ uint32_t WindowTreeHostX11::Dispatch(const base::NativeEvent& event) {
|
| }
|
| case FocusOut:
|
| if (xev->xfocus.mode != NotifyGrab)
|
| - delegate_->OnHostLostWindowCapture();
|
| + OnHostLostWindowCapture();
|
| break;
|
| case ConfigureNotify: {
|
| DCHECK_EQ(xwindow_, xev->xconfigure.event);
|
| @@ -551,9 +552,8 @@ void WindowTreeHostX11::SetBounds(const gfx::Rect& bounds) {
|
| // Even if the host window's size doesn't change, aura's root window
|
| // size, which is in DIP, changes when the scale changes.
|
| float current_scale = compositor()->device_scale_factor();
|
| - float new_scale = gfx::Screen::GetScreenFor(
|
| - delegate_->AsDispatcher()->window())->GetDisplayNearestWindow(
|
| - delegate_->AsDispatcher()->window()).device_scale_factor();
|
| + float new_scale = gfx::Screen::GetScreenFor(window())->
|
| + GetDisplayNearestWindow(window()).device_scale_factor();
|
| bool origin_changed = bounds_.origin() != bounds.origin();
|
| bool size_changed = bounds_.size() != bounds.size();
|
| XWindowChanges changes = {0};
|
| @@ -585,8 +585,7 @@ void WindowTreeHostX11::SetBounds(const gfx::Rect& bounds) {
|
| if (size_changed || current_scale != new_scale) {
|
| OnHostResized(bounds.size());
|
| } else {
|
| - delegate_->AsDispatcher()->window()->SchedulePaintInRect(
|
| - delegate_->AsDispatcher()->window()->bounds());
|
| + window()->SchedulePaintInRect(window()->bounds());
|
| }
|
| }
|
|
|
| @@ -709,7 +708,7 @@ void WindowTreeHostX11::PostNativeEvent(
|
| xevent.xmotion.time = CurrentTime;
|
|
|
| gfx::Point point(xevent.xmotion.x, xevent.xmotion.y);
|
| - delegate_->AsDispatcher()->host()->ConvertPointToNativeScreen(&point);
|
| + ConvertPointToNativeScreen(&point);
|
| xevent.xmotion.x_root = point.x();
|
| xevent.xmotion.y_root = point.y();
|
| }
|
| @@ -749,14 +748,11 @@ void WindowTreeHostX11::OnWindowInitialized(Window* window) {
|
|
|
| void WindowTreeHostX11::OnRootWindowInitialized(
|
| WindowEventDispatcher* d) {
|
| - // UpdateIsInternalDisplay relies on:
|
| - // 1. delegate_ pointing to WindowEventDispatcher - available after
|
| - // SetDelegate.
|
| - // 2. WED's kDisplayIdKey property set - available by the time
|
| - // WED::Init is called.
|
| - // (set in DisplayManager::CreateRootWindowForDisplay)
|
| + // UpdateIsInternalDisplay relies on WED's kDisplayIdKey property being set
|
| + // available by the time WED::Init is called. (set in
|
| + // DisplayManager::CreateRootWindowForDisplay)
|
| // Ready when NotifyRootWindowInitialized is called from WED::Init.
|
| - if (!delegate_ || d != dispatcher())
|
| + if (d != dispatcher())
|
| return;
|
| UpdateIsInternalDisplay();
|
|
|
| @@ -766,7 +762,7 @@ void WindowTreeHostX11::OnRootWindowInitialized(
|
| }
|
|
|
| ui::EventProcessor* WindowTreeHostX11::GetEventProcessor() {
|
| - return delegate_->GetEventProcessor();
|
| + return dispatcher();
|
| }
|
|
|
| void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) {
|
|
|