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

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc

Issue 11818065: OK, here's john's patch plus my sync stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Redisable PlatformAppBrowserTest.WebContentsHasFocus on aura Created 7 years, 10 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 | « chrome/test/base/chrome_test_launcher.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc
index cc2a404e27e86d7ccec266013668610884342216..81c2c7852f100ad4264865d34b452810bc1b1e31 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc
@@ -451,10 +451,18 @@ gfx::Rect DesktopRootWindowHostLinux::GetWorkAreaBoundsInScreen() const {
return gfx::Rect(value[0], value[1], value[2], value[3]);
}
- // TODO(erg): As a fallback, we should return the bounds for the current
- // monitor. However, that's pretty difficult and requires futzing with XRR.
- NOTIMPLEMENTED();
- return gfx::Rect();
+ // Fetch the geometry of the root window.
+ Window root;
+ int x, y;
+ unsigned int width, height;
+ unsigned int border_width, depth;
+ if (!XGetGeometry(xdisplay_, x_root_window_, &root, &x, &y,
+ &width, &height, &border_width, &depth)) {
+ NOTIMPLEMENTED();
+ return gfx::Rect(0, 0, 10, 10);
+ }
+
+ return gfx::Rect(x, y, width, height);
}
void DesktopRootWindowHostLinux::SetShape(gfx::NativeRegion native_region) {
@@ -692,6 +700,10 @@ void DesktopRootWindowHostLinux::SetBounds(const gfx::Rect& bounds) {
unsigned value_mask = 0;
if (size_changed) {
+ // X11 will send an XError at our process if have a 0 sized window.
+ DCHECK_GT(bounds.width(), 0);
+ DCHECK_GT(bounds.height(), 0);
+
changes.width = bounds.width();
changes.height = bounds.height();
value_mask |= CWHeight | CWWidth;
« no previous file with comments | « chrome/test/base/chrome_test_launcher.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698