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

Unified Diff: ui/base/x/x11_util.cc

Issue 16002008: linux_aura: Implement the fallback path in IsX11WindowFullScreen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index cf5f2a8582919894c93b3150cc7dda38635fde3f..ff1de58b0d6cd34b9091dc9f160ffb31da337ad6 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -1320,23 +1320,28 @@ bool IsX11WindowFullScreen(XID window) {
!= atom_properties.end())
return true;
+ gfx::Rect window_rect;
+ if (!ui::GetWindowRect(window, &window_rect))
+ return false;
+
#if defined(TOOLKIT_GTK)
// As the last resort, check if the window size is as large as the main
// screen.
GdkRectangle monitor_rect;
gdk_screen_get_monitor_geometry(gdk_screen_get_default(), 0, &monitor_rect);
- gfx::Rect window_rect;
- if (!ui::GetWindowRect(window, &window_rect))
- return false;
-
return monitor_rect.x == window_rect.x() &&
monitor_rect.y == window_rect.y() &&
monitor_rect.width == window_rect.width() &&
monitor_rect.height == window_rect.height();
#else
- NOTIMPLEMENTED();
- return false;
+ // We can't use gfx::Screen here because we don't have an aura::Window. So
+ // instead just look at the size of the default display.
+ ::Display* display = ui::GetXDisplay();
Daniel Erat 2013/06/01 03:05:59 this will probably break in the multi-monitor case
+ ::Screen* screen = DefaultScreenOfDisplay(display);
+ int width = WidthOfScreen(screen);
+ int height = HeightOfScreen(screen);
+ return window_rect.size() == gfx::Size(width, height);
#endif
}
« 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