Chromium Code Reviews| 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 |
| } |