summaryrefslogtreecommitdiffstats
path: root/ui/aura/root_window_host_linux.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-14 00:57:22 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-14 00:57:22 +0000
commit3368133419f71d1a185aa401abd916da4b21dc84 (patch)
treebbaafdc77cc8f616a1bf04ad914082ba04f0b975 /ui/aura/root_window_host_linux.cc
parent8ef10f310caa722660400ecb6a8c84623566aeb2 (diff)
downloadchromium_src-3368133419f71d1a185aa401abd916da4b21dc84.zip
chromium_src-3368133419f71d1a185aa401abd916da4b21dc84.tar.gz
chromium_src-3368133419f71d1a185aa401abd916da4b21dc84.tar.bz2
Update display info and notify the root window even when the only device scale has changed
R=sky@chromium.org BUG=132566 TEST=added new test case. Review URL: https://chromiumcodereview.appspot.com/10534151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/root_window_host_linux.cc')
-rw-r--r--ui/aura/root_window_host_linux.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index aa71322..419cbb81 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -34,6 +34,7 @@
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/screen.h"
using std::max;
using std::min;
@@ -811,8 +812,15 @@ gfx::Rect RootWindowHostLinux::GetBounds() const {
}
void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) {
- bool size_changed = bounds_.size() != bounds.size();
- if (bounds == 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 = root_window_->compositor()->device_scale_factor();
+ float new_scale =
+ gfx::Screen::GetMonitorNearestWindow(root_window_).device_scale_factor();
+ bool size_changed = bounds_.size() != bounds.size() ||
+ current_scale != new_scale;
+
+ if (!size_changed) {
root_window_->SchedulePaintInRect(root_window_->bounds());
return;
}