| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura/desktop_host.h" | 5 #include "ui/aura/desktop_host.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/message_pump_x.h" | 8 #include "base/message_pump_x.h" |
| 9 #include "ui/aura/desktop.h" | 9 #include "ui/aura/desktop.h" |
| 10 #include "ui/aura/event.h" | 10 #include "ui/aura/event.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 case MotionNotify: { | 91 case MotionNotify: { |
| 92 MouseEvent mouseev(xev); | 92 MouseEvent mouseev(xev); |
| 93 handled = desktop_->OnMouseEvent(mouseev); | 93 handled = desktop_->OnMouseEvent(mouseev); |
| 94 break; | 94 break; |
| 95 } | 95 } |
| 96 | 96 |
| 97 case ConfigureNotify: { | 97 case ConfigureNotify: { |
| 98 DCHECK_EQ(xdisplay_, xev->xconfigure.display); | 98 DCHECK_EQ(xdisplay_, xev->xconfigure.display); |
| 99 DCHECK_EQ(xwindow_, xev->xconfigure.window); | 99 DCHECK_EQ(xwindow_, xev->xconfigure.window); |
| 100 DCHECK_EQ(xwindow_, xev->xconfigure.event); | 100 DCHECK_EQ(xwindow_, xev->xconfigure.event); |
| 101 desktop_->OnHostResized(gfx::Size(xev->xconfigure.width, | 101 |
| 102 xev->xconfigure.height)); | 102 // It's possible that the X window may be resized by some other means than |
| 103 // from within aura (e.g. the X window manager can change the size). Make |
| 104 // sure the desktop size is maintained properly. |
| 105 gfx::Size size(xev->xconfigure.width, xev->xconfigure.height); |
| 106 if (bounds_.size() != size) |
| 107 bounds_.set_size(size); |
| 108 desktop_->OnHostResized(size); |
| 103 handled = true; | 109 handled = true; |
| 104 break; | 110 break; |
| 105 } | 111 } |
| 106 } | 112 } |
| 107 return handled ? EVENT_PROCESSED : EVENT_IGNORED; | 113 return handled ? EVENT_PROCESSED : EVENT_IGNORED; |
| 108 } | 114 } |
| 109 | 115 |
| 110 void DesktopHostLinux::SetDesktop(Desktop* desktop) { | 116 void DesktopHostLinux::SetDesktop(Desktop* desktop) { |
| 111 desktop_ = desktop; | 117 desktop_ = desktop; |
| 112 } | 118 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 137 } | 143 } |
| 138 | 144 |
| 139 } // namespace | 145 } // namespace |
| 140 | 146 |
| 141 // static | 147 // static |
| 142 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) { | 148 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) { |
| 143 return new DesktopHostLinux(bounds); | 149 return new DesktopHostLinux(bounds); |
| 144 } | 150 } |
| 145 | 151 |
| 146 } // namespace aura | 152 } // namespace aura |
| OLD | NEW |