X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fui%2Fgfx%2Fscreen_android.cc;h=31e3baaeea5bf4c77677dd37e72216857d8e41bb;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=9114b8554537519fb2eec3966cc4c12710b308ab;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ui/gfx/screen_android.cc b/src/ui/gfx/screen_android.cc index 9114b85..31e3baa 100644 --- a/src/ui/gfx/screen_android.cc +++ b/src/ui/gfx/screen_android.cc @@ -33,10 +33,16 @@ class ScreenAndroid : public Screen { virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { gfx::DeviceDisplayInfo device_info; const float device_scale_factor = device_info.GetDIPScale(); + // Note: GetPhysicalDisplayWidth/Height() does not subtract window + // decorations etc. Use it instead of GetDisplayWidth/Height() when + // available. const gfx::Rect bounds_in_pixels = - gfx::Rect( - device_info.GetDisplayWidth(), - device_info.GetDisplayHeight()); + gfx::Rect(device_info.GetPhysicalDisplayWidth() + ? device_info.GetPhysicalDisplayWidth() + : device_info.GetDisplayWidth(), + device_info.GetPhysicalDisplayHeight() + ? device_info.GetPhysicalDisplayHeight() + : device_info.GetDisplayHeight()); const gfx::Rect bounds_in_dip = gfx::Rect(gfx::ToCeiledSize(gfx::ScaleSize( bounds_in_pixels.size(), 1.0f / device_scale_factor)));