| 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_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_root_window_host_linux.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
| 8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
| 9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
| 10 | 10 |
| 11 #include "base/message_pump_aurax11.h" | 11 #include "base/message_pump_aurax11.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/utf_string_conversions.h" |
| 13 #include "ui/aura/client/screen_position_client.h" | 14 #include "ui/aura/client/screen_position_client.h" |
| 14 #include "ui/aura/client/user_action_client.h" | 15 #include "ui/aura/client/user_action_client.h" |
| 15 #include "ui/aura/desktop/desktop_activation_client.h" | 16 #include "ui/aura/desktop/desktop_activation_client.h" |
| 16 #include "ui/aura/desktop/desktop_dispatcher_client.h" | 17 #include "ui/aura/desktop/desktop_dispatcher_client.h" |
| 17 #include "ui/aura/focus_manager.h" | 18 #include "ui/aura/focus_manager.h" |
| 18 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/shared/compound_event_filter.h" | 20 #include "ui/aura/shared/compound_event_filter.h" |
| 20 #include "ui/aura/shared/input_method_event_filter.h" | 21 #include "ui/aura/shared/input_method_event_filter.h" |
| 21 #include "ui/base/touch/touch_factory.h" | 22 #include "ui/base/touch/touch_factory.h" |
| 22 #include "ui/base/x/x11_util.h" | 23 #include "ui/base/x/x11_util.h" |
| 23 #include "ui/views/widget/desktop_capture_client.h" | 24 #include "ui/views/widget/desktop_capture_client.h" |
| 25 #include "ui/views/widget/desktop_layout_manager.h" |
| 24 #include "ui/views/widget/x11_desktop_handler.h" | 26 #include "ui/views/widget/x11_desktop_handler.h" |
| 25 #include "ui/views/widget/x11_window_event_filter.h" | 27 #include "ui/views/widget/x11_window_event_filter.h" |
| 26 | 28 |
| 27 namespace views { | 29 namespace views { |
| 28 | 30 |
| 29 namespace { | 31 namespace { |
| 30 | 32 |
| 31 // Standard Linux mouse buttons for going back and forward. | 33 // Standard Linux mouse buttons for going back and forward. |
| 32 const int kBackMouseButton = 8; | 34 const int kBackMouseButton = 8; |
| 33 const int kForwardMouseButton = 9; | 35 const int kForwardMouseButton = 9; |
| 34 | 36 |
| 35 const char* kAtomsToCache[] = { | 37 const char* kAtomsToCache[] = { |
| 36 "WM_DELETE_WINDOW", | 38 "WM_DELETE_WINDOW", |
| 37 "_NET_WM_PING", | 39 "_NET_WM_PING", |
| 38 "_NET_WM_PID", | 40 "_NET_WM_PID", |
| 39 "WM_S0", | 41 "WM_S0", |
| 40 NULL | 42 NULL |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 } // namespace | 45 } // namespace |
| 44 | 46 |
| 45 //////////////////////////////////////////////////////////////////////////////// | 47 //////////////////////////////////////////////////////////////////////////////// |
| 46 // DesktopRootWindowHostLinux, public: | 48 // DesktopRootWindowHostLinux, public: |
| 47 | 49 |
| 48 DesktopRootWindowHostLinux::DesktopRootWindowHostLinux() | 50 DesktopRootWindowHostLinux::DesktopRootWindowHostLinux( |
| 51 internal::NativeWidgetDelegate* native_widget_delegate, |
| 52 const gfx::Rect& initial_bounds) |
| 49 : xdisplay_(base::MessagePumpAuraX11::GetDefaultXDisplay()), | 53 : xdisplay_(base::MessagePumpAuraX11::GetDefaultXDisplay()), |
| 50 xwindow_(0), | 54 xwindow_(0), |
| 51 x_root_window_(DefaultRootWindow(xdisplay_)), | 55 x_root_window_(DefaultRootWindow(xdisplay_)), |
| 52 atom_cache_(xdisplay_, kAtomsToCache), | 56 atom_cache_(xdisplay_, kAtomsToCache), |
| 53 window_mapped_(false), | 57 window_mapped_(false), |
| 54 focus_when_shown_(false) { | 58 focus_when_shown_(false), |
| 59 native_widget_delegate_(native_widget_delegate) { |
| 55 } | 60 } |
| 56 | 61 |
| 57 DesktopRootWindowHostLinux::~DesktopRootWindowHostLinux() { | 62 DesktopRootWindowHostLinux::~DesktopRootWindowHostLinux() { |
| 58 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(xwindow_); | 63 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(xwindow_); |
| 59 XDestroyWindow(xdisplay_, xwindow_); | 64 XDestroyWindow(xdisplay_, xwindow_); |
| 60 } | 65 } |
| 61 | 66 |
| 62 //////////////////////////////////////////////////////////////////////////////// | 67 //////////////////////////////////////////////////////////////////////////////// |
| 63 // DesktopRootWindowHostLinux, private: | 68 // DesktopRootWindowHostLinux, private: |
| 64 | 69 |
| 65 void DesktopRootWindowHostLinux::InitX11Window(const gfx::Rect& bounds) { | 70 void DesktopRootWindowHostLinux::InitX11Window( |
| 71 const Widget::InitParams& params) { |
| 72 unsigned long attribute_mask = CWBackPixmap; |
| 66 XSetWindowAttributes swa; | 73 XSetWindowAttributes swa; |
| 67 memset(&swa, 0, sizeof(swa)); | 74 memset(&swa, 0, sizeof(swa)); |
| 68 swa.background_pixmap = None; | 75 swa.background_pixmap = None; |
| 76 |
| 77 if (params.type == Widget::InitParams::TYPE_MENU) { |
| 78 swa.override_redirect = True; |
| 79 attribute_mask |= CWOverrideRedirect; |
| 80 } |
| 81 |
| 69 xwindow_ = XCreateWindow( | 82 xwindow_ = XCreateWindow( |
| 70 xdisplay_, x_root_window_, | 83 xdisplay_, x_root_window_, |
| 71 bounds.x(), bounds.y(), bounds.width(), bounds.height(), | 84 params.bounds.x(), params.bounds.y(), |
| 85 params.bounds.width(), params.bounds.height(), |
| 72 0, // border width | 86 0, // border width |
| 73 CopyFromParent, // depth | 87 CopyFromParent, // depth |
| 74 InputOutput, | 88 InputOutput, |
| 75 CopyFromParent, // visual | 89 CopyFromParent, // visual |
| 76 CWBackPixmap, | 90 attribute_mask, |
| 77 &swa); | 91 &swa); |
| 78 base::MessagePumpAuraX11::Current()->AddDispatcherForWindow(this, xwindow_); | 92 base::MessagePumpAuraX11::Current()->AddDispatcherForWindow(this, xwindow_); |
| 79 | 93 |
| 80 // TODO(erg): Maybe need to set a ViewProp here like in RWHL::RWHL(). | 94 // TODO(erg): Maybe need to set a ViewProp here like in RWHL::RWHL(). |
| 81 | 95 |
| 82 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | | 96 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | |
| 83 KeyPressMask | KeyReleaseMask | | 97 KeyPressMask | KeyReleaseMask | |
| 84 EnterWindowMask | LeaveWindowMask | | 98 EnterWindowMask | LeaveWindowMask | |
| 85 ExposureMask | VisibilityChangeMask | | 99 ExposureMask | VisibilityChangeMask | |
| 86 StructureNotifyMask | PropertyChangeMask | | 100 StructureNotifyMask | PropertyChangeMask | |
| (...skipping 19 matching lines...) Expand all Loading... |
| 106 // Likewise, the X server needs to know this window's pid so it knows which | 120 // Likewise, the X server needs to know this window's pid so it knows which |
| 107 // program to kill if the window hangs. | 121 // program to kill if the window hangs. |
| 108 pid_t pid = getpid(); | 122 pid_t pid = getpid(); |
| 109 XChangeProperty(xdisplay_, | 123 XChangeProperty(xdisplay_, |
| 110 xwindow_, | 124 xwindow_, |
| 111 atom_cache_.GetAtom("_NET_WM_PID"), | 125 atom_cache_.GetAtom("_NET_WM_PID"), |
| 112 XA_CARDINAL, | 126 XA_CARDINAL, |
| 113 32, | 127 32, |
| 114 PropModeReplace, | 128 PropModeReplace, |
| 115 reinterpret_cast<unsigned char*>(&pid), 1); | 129 reinterpret_cast<unsigned char*>(&pid), 1); |
| 116 | |
| 117 // TODO(erg): Now that we're forked from RootWindowHostLinux, we should be | |
| 118 // doing a much better job about communicating things like the window title | |
| 119 // and icon to the window manager, which should replace this piece of copied | |
| 120 // code. | |
| 121 static int root_window_number = 0; | |
| 122 std::string name = StringPrintf("aura_root_%d", root_window_number++); | |
| 123 XStoreName(xdisplay_, xwindow_, name.c_str()); | |
| 124 } | 130 } |
| 125 | 131 |
| 126 // TODO(erg): This method should basically be everything I need form | 132 // TODO(erg): This method should basically be everything I need form |
| 127 // RootWindowHostLinux::RootWindowHostLinux(). | 133 // RootWindowHostLinux::RootWindowHostLinux(). |
| 128 void DesktopRootWindowHostLinux::InitRootWindow( | 134 void DesktopRootWindowHostLinux::InitRootWindow( |
| 129 const Widget::InitParams& params) { | 135 const Widget::InitParams& params) { |
| 130 aura::RootWindow::CreateParams rw_params(params.bounds); | 136 bounds_ = params.bounds; |
| 137 |
| 138 aura::RootWindow::CreateParams rw_params(bounds_); |
| 131 rw_params.host = this; | 139 rw_params.host = this; |
| 132 root_window_.reset(new aura::RootWindow(rw_params)); | 140 root_window_.reset(new aura::RootWindow(rw_params)); |
| 133 root_window_->Init(); | 141 root_window_->Init(); |
| 134 root_window_->AddChild(content_window_); | 142 root_window_->AddChild(content_window_); |
| 143 root_window_->SetLayoutManager(new DesktopLayoutManager(root_window_.get())); |
| 135 root_window_host_delegate_ = root_window_.get(); | 144 root_window_host_delegate_ = root_window_.get(); |
| 136 | 145 |
| 146 // If we're given a parent, we need to mark ourselves as transient to another |
| 147 // window. Otherwise activation gets screwy. |
| 148 gfx::NativeView parent = params.GetParent(); |
| 149 if (!params.child && params.GetParent()) |
| 150 parent->AddTransientChild(content_window_); |
| 151 |
| 152 native_widget_delegate_->OnNativeWidgetCreated(); |
| 153 |
| 137 capture_client_.reset(new DesktopCaptureClient); | 154 capture_client_.reset(new DesktopCaptureClient); |
| 138 aura::client::SetCaptureClient(root_window_.get(), capture_client_.get()); | 155 aura::client::SetCaptureClient(root_window_.get(), capture_client_.get()); |
| 139 | 156 |
| 140 root_window_->set_focus_manager( | 157 root_window_->set_focus_manager( |
| 141 X11DesktopHandler::get()->get_focus_manager()); | 158 X11DesktopHandler::get()->get_focus_manager()); |
| 142 | 159 |
| 143 aura::DesktopActivationClient* activation_client = | 160 aura::DesktopActivationClient* activation_client = |
| 144 X11DesktopHandler::get()->get_activation_client(); | 161 X11DesktopHandler::get()->get_activation_client(); |
| 145 aura::client::SetActivationClient( | 162 aura::client::SetActivationClient( |
| 146 root_window_.get(), activation_client); | 163 root_window_.get(), activation_client); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 175 //////////////////////////////////////////////////////////////////////////////// | 192 //////////////////////////////////////////////////////////////////////////////// |
| 176 // DesktopRootWindowHostLinux, DesktopRootWindowHost implementation: | 193 // DesktopRootWindowHostLinux, DesktopRootWindowHost implementation: |
| 177 | 194 |
| 178 void DesktopRootWindowHostLinux::Init(aura::Window* content_window, | 195 void DesktopRootWindowHostLinux::Init(aura::Window* content_window, |
| 179 const Widget::InitParams& params) { | 196 const Widget::InitParams& params) { |
| 180 content_window_ = content_window; | 197 content_window_ = content_window; |
| 181 | 198 |
| 182 // TODO(erg): Check whether we *should* be building a RootWindowHost here, or | 199 // TODO(erg): Check whether we *should* be building a RootWindowHost here, or |
| 183 // whether we should be proxying requests to another DRWHL. | 200 // whether we should be proxying requests to another DRWHL. |
| 184 | 201 |
| 185 // TODO(erg): We can finally solve the role problem! Based on params, try to | 202 // In some situations, views tries to make a zero sized window, and that |
| 186 // determine whether this is a utility window such as a menu. | 203 // makes us crash. Make sure we have valid sizes. |
| 204 Widget::InitParams sanitized_params = params; |
| 205 if (sanitized_params.bounds.width() == 0) |
| 206 sanitized_params.bounds.set_width(100); |
| 207 if (sanitized_params.bounds.height() == 0) |
| 208 sanitized_params.bounds.set_height(100); |
| 187 | 209 |
| 188 InitX11Window(params.bounds); | 210 InitX11Window(sanitized_params); |
| 189 InitRootWindow(params); | 211 InitRootWindow(sanitized_params); |
| 190 | |
| 191 // TODO(erg): This should be done by a LayoutManager instead of being a | |
| 192 // one-off hack. | |
| 193 content_window_->SetBounds(params.bounds); | |
| 194 | 212 |
| 195 // This needs to be the intersection of: | 213 // This needs to be the intersection of: |
| 196 // - NativeWidgetAura::InitNativeWidget() | 214 // - NativeWidgetAura::InitNativeWidget() |
| 197 // - DesktopNativeWidgetHelperAura::PreInitialize() | 215 // - DesktopNativeWidgetHelperAura::PreInitialize() |
| 198 } | 216 } |
| 199 | 217 |
| 200 void DesktopRootWindowHostLinux::Close() { | 218 void DesktopRootWindowHostLinux::Close() { |
| 201 // TODO(erg): | 219 // TODO(erg): |
| 202 NOTIMPLEMENTED(); | 220 NOTIMPLEMENTED(); |
| 203 } | 221 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 255 } |
| 238 | 256 |
| 239 void DesktopRootWindowHostLinux::CenterWindow(const gfx::Size& size) { | 257 void DesktopRootWindowHostLinux::CenterWindow(const gfx::Size& size) { |
| 240 // TODO(erg): | 258 // TODO(erg): |
| 241 NOTIMPLEMENTED(); | 259 NOTIMPLEMENTED(); |
| 242 } | 260 } |
| 243 | 261 |
| 244 void DesktopRootWindowHostLinux::GetWindowPlacement( | 262 void DesktopRootWindowHostLinux::GetWindowPlacement( |
| 245 gfx::Rect* bounds, | 263 gfx::Rect* bounds, |
| 246 ui::WindowShowState* show_state) const { | 264 ui::WindowShowState* show_state) const { |
| 247 // TODO(erg): | 265 *bounds = bounds_; |
| 248 NOTIMPLEMENTED(); | 266 |
| 267 // TODO(erg): This needs a better implementation. For now, we're just pass |
| 268 // back the normal state until we keep track of this. |
| 269 *show_state = ui::SHOW_STATE_NORMAL; |
| 249 } | 270 } |
| 250 | 271 |
| 251 gfx::Rect DesktopRootWindowHostLinux::GetWindowBoundsInScreen() const { | 272 gfx::Rect DesktopRootWindowHostLinux::GetWindowBoundsInScreen() const { |
| 252 // TODO(erg): | 273 return bounds_; |
| 253 NOTIMPLEMENTED(); | |
| 254 return gfx::Rect(); | |
| 255 } | 274 } |
| 256 | 275 |
| 257 gfx::Rect DesktopRootWindowHostLinux::GetClientAreaBoundsInScreen() const { | 276 gfx::Rect DesktopRootWindowHostLinux::GetClientAreaBoundsInScreen() const { |
| 258 // TODO(erg): | |
| 259 NOTIMPLEMENTED(); | 277 NOTIMPLEMENTED(); |
| 260 return gfx::Rect(100, 100); | 278 // TODO(erg): This is wrong, but would require looking at the actual views |
| 279 // hierarchy to do correctly. |
| 280 return bounds_; |
| 261 } | 281 } |
| 262 | 282 |
| 263 gfx::Rect DesktopRootWindowHostLinux::GetRestoredBounds() const { | 283 gfx::Rect DesktopRootWindowHostLinux::GetRestoredBounds() const { |
| 264 // TODO(erg): | 284 // TODO(erg): |
| 265 NOTIMPLEMENTED(); | 285 NOTIMPLEMENTED(); |
| 266 return gfx::Rect(); | 286 return gfx::Rect(); |
| 267 } | 287 } |
| 268 | 288 |
| 269 void DesktopRootWindowHostLinux::SetShape(gfx::NativeRegion native_region) { | 289 void DesktopRootWindowHostLinux::SetShape(gfx::NativeRegion native_region) { |
| 270 // TODO(erg): | 290 // TODO(erg): |
| 271 NOTIMPLEMENTED(); | 291 NOTIMPLEMENTED(); |
| 272 } | 292 } |
| 273 | 293 |
| 274 bool DesktopRootWindowHostLinux::ShouldUseNativeFrame() { | 294 bool DesktopRootWindowHostLinux::ShouldUseNativeFrame() { |
| 275 return false; | 295 return false; |
| 276 } | 296 } |
| 277 | 297 |
| 278 void DesktopRootWindowHostLinux::Activate() { | 298 void DesktopRootWindowHostLinux::Activate() { |
| 279 // TODO(erg): | 299 // TODO(erg): |
| 280 NOTIMPLEMENTED(); | 300 NOTIMPLEMENTED(); |
| 281 } | 301 } |
| 282 | 302 |
| 283 void DesktopRootWindowHostLinux::Deactivate() { | 303 void DesktopRootWindowHostLinux::Deactivate() { |
| 284 // TODO(erg): | 304 // TODO(erg): |
| 285 NOTIMPLEMENTED(); | 305 NOTIMPLEMENTED(); |
| 286 } | 306 } |
| 287 | 307 |
| 288 bool DesktopRootWindowHostLinux::IsActive() const { | 308 bool DesktopRootWindowHostLinux::IsActive() const { |
| 289 // TODO(erg): | 309 // TODO(erg): |
| 290 NOTIMPLEMENTED(); | 310 //NOTIMPLEMENTED(); |
| 291 return true; | 311 return true; |
| 292 } | 312 } |
| 293 | 313 |
| 294 void DesktopRootWindowHostLinux::Maximize() { | 314 void DesktopRootWindowHostLinux::Maximize() { |
| 295 // TODO(erg): | 315 // TODO(erg): |
| 296 NOTIMPLEMENTED(); | 316 NOTIMPLEMENTED(); |
| 297 } | 317 } |
| 298 | 318 |
| 299 void DesktopRootWindowHostLinux::Minimize() { | 319 void DesktopRootWindowHostLinux::Minimize() { |
| 300 // TODO(erg): | 320 // TODO(erg): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } | 356 } |
| 337 | 357 |
| 338 internal::InputMethodDelegate* | 358 internal::InputMethodDelegate* |
| 339 DesktopRootWindowHostLinux::GetInputMethodDelegate() { | 359 DesktopRootWindowHostLinux::GetInputMethodDelegate() { |
| 340 // TODO(erg): | 360 // TODO(erg): |
| 341 NOTIMPLEMENTED(); | 361 NOTIMPLEMENTED(); |
| 342 return NULL; | 362 return NULL; |
| 343 } | 363 } |
| 344 | 364 |
| 345 void DesktopRootWindowHostLinux::SetWindowTitle(const string16& title) { | 365 void DesktopRootWindowHostLinux::SetWindowTitle(const string16& title) { |
| 346 // TODO(erg): | 366 XStoreName(xdisplay_, xwindow_, UTF16ToUTF8(title).c_str()); |
| 347 NOTIMPLEMENTED(); | |
| 348 } | 367 } |
| 349 | 368 |
| 350 //////////////////////////////////////////////////////////////////////////////// | 369 //////////////////////////////////////////////////////////////////////////////// |
| 351 // DesktopRootWindowHostLinux, aura::RootWindowHost implementation: | 370 // DesktopRootWindowHostLinux, aura::RootWindowHost implementation: |
| 352 | 371 |
| 353 aura::RootWindow* DesktopRootWindowHostLinux::GetRootWindow() { | 372 aura::RootWindow* DesktopRootWindowHostLinux::GetRootWindow() { |
| 354 return root_window_.get(); | 373 return root_window_.get(); |
| 355 } | 374 } |
| 356 | 375 |
| 357 gfx::AcceleratedWidget DesktopRootWindowHostLinux::GetAcceleratedWidget() { | 376 gfx::AcceleratedWidget DesktopRootWindowHostLinux::GetAcceleratedWidget() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 382 if (window_mapped_) { | 401 if (window_mapped_) { |
| 383 XWithdrawWindow(xdisplay_, xwindow_, 0); | 402 XWithdrawWindow(xdisplay_, xwindow_, 0); |
| 384 window_mapped_ = false; | 403 window_mapped_ = false; |
| 385 } | 404 } |
| 386 } | 405 } |
| 387 | 406 |
| 388 void DesktopRootWindowHostLinux::ToggleFullScreen() { | 407 void DesktopRootWindowHostLinux::ToggleFullScreen() { |
| 389 } | 408 } |
| 390 | 409 |
| 391 gfx::Rect DesktopRootWindowHostLinux::GetBounds() const { | 410 gfx::Rect DesktopRootWindowHostLinux::GetBounds() const { |
| 392 return gfx::Rect(100, 100); | 411 return bounds_; |
| 393 } | 412 } |
| 394 | 413 |
| 395 void DesktopRootWindowHostLinux::SetBounds(const gfx::Rect& bounds) { | 414 void DesktopRootWindowHostLinux::SetBounds(const gfx::Rect& bounds) { |
| 415 bool size_changed = bounds.size() != bounds_.size(); |
| 416 |
| 417 if (bounds != bounds_) { |
| 418 XMoveResizeWindow(xdisplay_, xwindow_, bounds.x(), bounds.y(), |
| 419 bounds.width(), bounds.height()); |
| 420 bounds_ = bounds; |
| 421 } |
| 422 |
| 423 if (size_changed) |
| 424 root_window_host_delegate_->OnHostResized(bounds_.size()); |
| 425 else |
| 426 root_window_host_delegate_->OnHostPaint(); |
| 396 } | 427 } |
| 397 | 428 |
| 398 gfx::Point DesktopRootWindowHostLinux::GetLocationOnNativeScreen() const { | 429 gfx::Point DesktopRootWindowHostLinux::GetLocationOnNativeScreen() const { |
| 430 NOTIMPLEMENTED(); |
| 399 return gfx::Point(1, 1); | 431 return gfx::Point(1, 1); |
| 400 } | 432 } |
| 401 | 433 |
| 402 void DesktopRootWindowHostLinux::SetCapture() { | 434 void DesktopRootWindowHostLinux::SetCapture() { |
| 435 NOTIMPLEMENTED(); |
| 403 } | 436 } |
| 404 | 437 |
| 405 void DesktopRootWindowHostLinux::ReleaseCapture() { | 438 void DesktopRootWindowHostLinux::ReleaseCapture() { |
| 439 NOTIMPLEMENTED(); |
| 406 } | 440 } |
| 407 | 441 |
| 408 void DesktopRootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) { | 442 void DesktopRootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) { |
| 443 NOTIMPLEMENTED(); |
| 409 } | 444 } |
| 410 | 445 |
| 411 void DesktopRootWindowHostLinux::ShowCursor(bool show) { | 446 void DesktopRootWindowHostLinux::ShowCursor(bool show) { |
| 447 NOTIMPLEMENTED(); |
| 412 } | 448 } |
| 413 | 449 |
| 414 bool DesktopRootWindowHostLinux::QueryMouseLocation( | 450 bool DesktopRootWindowHostLinux::QueryMouseLocation( |
| 415 gfx::Point* location_return) { | 451 gfx::Point* location_return) { |
| 452 NOTIMPLEMENTED(); |
| 416 return false; | 453 return false; |
| 417 } | 454 } |
| 418 | 455 |
| 419 bool DesktopRootWindowHostLinux::ConfineCursorToRootWindow() { | 456 bool DesktopRootWindowHostLinux::ConfineCursorToRootWindow() { |
| 457 NOTIMPLEMENTED(); |
| 420 return false; | 458 return false; |
| 421 } | 459 } |
| 422 | 460 |
| 423 void DesktopRootWindowHostLinux::UnConfineCursor() { | 461 void DesktopRootWindowHostLinux::UnConfineCursor() { |
| 462 NOTIMPLEMENTED(); |
| 424 } | 463 } |
| 425 | 464 |
| 426 void DesktopRootWindowHostLinux::MoveCursorTo(const gfx::Point& location) { | 465 void DesktopRootWindowHostLinux::MoveCursorTo(const gfx::Point& location) { |
| 466 NOTIMPLEMENTED(); |
| 427 } | 467 } |
| 428 | 468 |
| 429 void DesktopRootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) { | 469 void DesktopRootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) { |
| 430 static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME"; | 470 static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME"; |
| 431 focus_when_shown_ = focus_when_shown; | 471 focus_when_shown_ = focus_when_shown; |
| 432 if (IsWindowManagerPresent() && !focus_when_shown_) { | 472 if (IsWindowManagerPresent() && !focus_when_shown_) { |
| 433 ui::SetIntProperty(xwindow_, | 473 ui::SetIntProperty(xwindow_, |
| 434 k_NET_WM_USER_TIME, | 474 k_NET_WM_USER_TIME, |
| 435 k_NET_WM_USER_TIME, | 475 k_NET_WM_USER_TIME, |
| 436 0); | 476 0); |
| 437 } | 477 } |
| 438 } | 478 } |
| 439 | 479 |
| 440 bool DesktopRootWindowHostLinux::GrabSnapshot( | 480 bool DesktopRootWindowHostLinux::GrabSnapshot( |
| 441 const gfx::Rect& snapshot_bounds, | 481 const gfx::Rect& snapshot_bounds, |
| 442 std::vector<unsigned char>* png_representation) { | 482 std::vector<unsigned char>* png_representation) { |
| 483 NOTIMPLEMENTED(); |
| 443 return false; | 484 return false; |
| 444 } | 485 } |
| 445 | 486 |
| 446 void DesktopRootWindowHostLinux::PostNativeEvent( | 487 void DesktopRootWindowHostLinux::PostNativeEvent( |
| 447 const base::NativeEvent& native_event) { | 488 const base::NativeEvent& native_event) { |
| 448 DCHECK(xwindow_); | 489 DCHECK(xwindow_); |
| 449 DCHECK(xdisplay_); | 490 DCHECK(xdisplay_); |
| 450 XEvent xevent = *native_event; | 491 XEvent xevent = *native_event; |
| 451 xevent.xany.display = xdisplay_; | 492 xevent.xany.display = xdisplay_; |
| 452 xevent.xany.window = xwindow_; | 493 xevent.xany.window = xwindow_; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 return true; | 733 return true; |
| 693 } | 734 } |
| 694 | 735 |
| 695 //////////////////////////////////////////////////////////////////////////////// | 736 //////////////////////////////////////////////////////////////////////////////// |
| 696 // DesktopRootWindowHost, public: | 737 // DesktopRootWindowHost, public: |
| 697 | 738 |
| 698 // static | 739 // static |
| 699 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 740 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 700 internal::NativeWidgetDelegate* native_widget_delegate, | 741 internal::NativeWidgetDelegate* native_widget_delegate, |
| 701 const gfx::Rect& initial_bounds) { | 742 const gfx::Rect& initial_bounds) { |
| 702 return new DesktopRootWindowHostLinux; | 743 return new DesktopRootWindowHostLinux(native_widget_delegate, initial_bounds); |
| 703 } | 744 } |
| 704 | 745 |
| 705 } // namespace views | 746 } // namespace views |
| OLD | NEW |