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/root_window_host_linux.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment Created 8 years, 3 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
Index: ui/aura/root_window_host_linux.cc
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index dc76e68c15a77451dc054e586324de7276e846db..76ab16c9df163ef26c502e09bdbea3de71c935aa 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -40,6 +40,8 @@
#include "base/chromeos/chromeos_version.h"
#endif
+#include "base/debug/stack_trace.h"
+
using std::max;
using std::min;
@@ -748,12 +750,22 @@ void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) {
delegate_->AsRootWindow()).device_scale_factor();
bool size_changed = bounds_.size() != bounds.size() ||
current_scale != new_scale;
+ XWindowChanges changes = {0};
+ unsigned value_mask = 0;
- if (bounds.size() != bounds_.size())
- XResizeWindow(xdisplay_, xwindow_, bounds.width(), bounds.height());
+ if (bounds.size() != bounds_.size()) {
+ changes.width = bounds.width();
+ changes.height = bounds.height();
+ value_mask = CWHeight | CWWidth;
+ }
- if (bounds.origin() != bounds_.origin())
- XMoveWindow(xdisplay_, xwindow_, bounds.x(), bounds.y());
+ if (bounds.origin() != bounds_.origin()) {
+ changes.x = bounds.x();
+ changes.y = bounds.y();
+ value_mask |= CWX | CWY;
+ }
+ if (value_mask)
+ XConfigureWindow(xdisplay_, xwindow_, value_mask, &changes);
// Assume that the resize will go through as requested, which should be the
// case if we're running without a window manager. If there's a window
« ash/shell.cc ('K') | « ui/aura/display_manager.h ('k') | ui/aura/single_display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698