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/Xcursor/Xcursor.h> | 8 #include <X11/Xcursor/Xcursor.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <X11/cursorfont.h> | 10 #include <X11/cursorfont.h> |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 | 809 |
810 gfx::Rect RootWindowHostLinux::GetBounds() const { | 810 gfx::Rect RootWindowHostLinux::GetBounds() const { |
811 return bounds_; | 811 return bounds_; |
812 } | 812 } |
813 | 813 |
814 void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) { | 814 void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) { |
815 // Even if the host window's size doesn't change, aura's root window | 815 // Even if the host window's size doesn't change, aura's root window |
816 // size, which is in DIP, changes when the scale changes. | 816 // size, which is in DIP, changes when the scale changes. |
817 float current_scale = root_window_->compositor()->device_scale_factor(); | 817 float current_scale = root_window_->compositor()->device_scale_factor(); |
818 float new_scale = | 818 float new_scale = |
819 gfx::Screen::GetMonitorNearestWindow(root_window_).device_scale_factor(); | 819 gfx::Screen::GetDisplayNearestWindow(root_window_).device_scale_factor(); |
820 bool size_changed = bounds_.size() != bounds.size() || | 820 bool size_changed = bounds_.size() != bounds.size() || |
821 current_scale != new_scale; | 821 current_scale != new_scale; |
822 | 822 |
823 if (!size_changed) { | 823 if (!size_changed) { |
824 root_window_->SchedulePaintInRect(root_window_->bounds()); | 824 root_window_->SchedulePaintInRect(root_window_->bounds()); |
825 return; | 825 return; |
826 } | 826 } |
827 | 827 |
828 if (bounds.size() != bounds_.size()) | 828 if (bounds.size() != bounds_.size()) |
829 XResizeWindow(xdisplay_, xwindow_, bounds.width(), bounds.height()); | 829 XResizeWindow(xdisplay_, xwindow_, bounds.width(), bounds.height()); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); | 1056 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); |
1057 } | 1057 } |
1058 | 1058 |
1059 // static | 1059 // static |
1060 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1060 gfx::Size RootWindowHost::GetNativeScreenSize() { |
1061 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); | 1061 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
1062 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1062 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
1063 } | 1063 } |
1064 | 1064 |
1065 } // namespace aura | 1065 } // namespace aura |
OLD | NEW |