Commit bdbe1875 authored by oshima@google.com's avatar oshima@google.com

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
parent f44edee7
......@@ -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());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment