summaryrefslogtreecommitdiffstats
path: root/ui/aura/desktop_host_linux.cc
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-24 16:50:44 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-24 16:50:44 +0000
commitbdbe18751c746e12625bd98264a78144f6dba393 (patch)
treeee6fbd5eb4788f6c030e5e554fecbbc5ebf5d7c7 /ui/aura/desktop_host_linux.cc
parentf44edee7140bf3b66aa5a5b48643889c761fab48 (diff)
downloadchromium_src-bdbe18751c746e12625bd98264a78144f6dba393.zip
chromium_src-bdbe18751c746e12625bd98264a78144f6dba393.tar.gz
chromium_src-bdbe18751c746e12625bd98264a78144f6dba393.tar.bz2
Notify Desktop::OnHostRezied only when the size has changed or resize is requsted
BUG=none TEST=none Review URL: http://codereview.chromium.org/8359005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/desktop_host_linux.cc')
-rw-r--r--ui/aura/desktop_host_linux.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc
index ed47ca2..c41a9e9 100644
--- a/ui/aura/desktop_host_linux.cc
+++ b/ui/aura/desktop_host_linux.cc
@@ -213,6 +213,10 @@ class DesktopHostLinux : public DesktopHost {
// The size of |xwindow_|.
gfx::Rect bounds_;
+ // True while we requested configure, but haven't recieved configure event
+ // yet.
+ bool expect_configure_event_;
+
DISALLOW_COPY_AND_ASSIGN(DesktopHostLinux);
};
@@ -309,9 +313,11 @@ base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch(
// from within aura (e.g. the X window manager can change the size). Make
// sure the desktop size is maintained properly.
gfx::Size size(xev->xconfigure.width, xev->xconfigure.height);
- if (bounds_.size() != size)
+ if (bounds_.size() != size || expect_configure_event_) {
+ expect_configure_event_ = false;
bounds_.set_size(size);
- desktop_->OnHostResized(size);
+ desktop_->OnHostResized(size);
+ }
handled = true;
break;
}
@@ -394,6 +400,7 @@ gfx::Size DesktopHostLinux::GetSize() const {
void DesktopHostLinux::SetSize(const gfx::Size& size) {
if (bounds_.size() == size)
return;
+ expect_configure_event_ = true;
bounds_.set_size(size);
XResizeWindow(xdisplay_, xwindow_, size.width(), size.height());
}