Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: ui/aura/desktop_host_linux.cc

Issue 8359005: Notify Desktop::OnHostRezied only when the size has changed or resize is requsted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/desktop_host_linux.cc
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc
index ed47ca21dad976628412990014f2c581be1e0b07..c41a9e986a8030122d1bc72a6813fecc86acc87a 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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698