| 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/aura/root_window_host_linux.h" | 5 #include "ui/aura/root_window_host_linux.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #include <X11/extensions/Xfixes.h> | 10 #include <X11/extensions/Xfixes.h> |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 break; | 587 break; |
| 588 } | 588 } |
| 589 } | 589 } |
| 590 return true; | 590 return true; |
| 591 } | 591 } |
| 592 | 592 |
| 593 void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) { | 593 void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) { |
| 594 root_window_ = root_window; | 594 root_window_ = root_window; |
| 595 } | 595 } |
| 596 | 596 |
| 597 RootWindow* RootWindowHostLinux::GetRootWindow() { |
| 598 return root_window_; |
| 599 } |
| 600 |
| 597 gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() { | 601 gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() { |
| 598 return xwindow_; | 602 return xwindow_; |
| 599 } | 603 } |
| 600 | 604 |
| 601 void RootWindowHostLinux::Show() { | 605 void RootWindowHostLinux::Show() { |
| 602 // Before we map the window, set size hints. Otherwise, some window managers | 606 // Before we map the window, set size hints. Otherwise, some window managers |
| 603 // will ignore toplevel XMoveWindow commands. | 607 // will ignore toplevel XMoveWindow commands. |
| 604 XSizeHints size_hints; | 608 XSizeHints size_hints; |
| 605 size_hints.flags = PPosition; | 609 size_hints.flags = PPosition; |
| 606 size_hints.x = bounds_.x(); | 610 size_hints.x = bounds_.x(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 ui::GetXCursor(CursorShapeFromNative(cursor)); | 797 ui::GetXCursor(CursorShapeFromNative(cursor)); |
| 794 XDefineCursor(xdisplay_, xwindow_, xcursor); | 798 XDefineCursor(xdisplay_, xwindow_, xcursor); |
| 795 } | 799 } |
| 796 | 800 |
| 797 // static | 801 // static |
| 798 RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { | 802 RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { |
| 799 return new RootWindowHostLinux(bounds); | 803 return new RootWindowHostLinux(bounds); |
| 800 } | 804 } |
| 801 | 805 |
| 802 // static | 806 // static |
| 807 RootWindowHost* RootWindowHost::GetForAcceleratedWidget( |
| 808 gfx::AcceleratedWidget accelerated_widget) { |
| 809 NOTIMPLEMENTED(); |
| 810 return NULL; // TODO(erg): implement if necessary or remove this comment. |
| 811 } |
| 812 |
| 813 // static |
| 803 gfx::Size RootWindowHost::GetNativeScreenSize() { | 814 gfx::Size RootWindowHost::GetNativeScreenSize() { |
| 804 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 815 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
| 805 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 816 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
| 806 } | 817 } |
| 807 | 818 |
| 808 } // namespace aura | 819 } // namespace aura |
| OLD | NEW |