From 86a4069ed0e62a6802fc3f0f85e42efe472884ef Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 24 Sep 2013 14:58:58 -0700 Subject: [PATCH] Bug 914776 - Fix touch event coordinates when rotated, r=m1 --- widget/gonk/nsAppShell.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/widget/gonk/nsAppShell.cpp b/widget/gonk/nsAppShell.cpp index c71e2afeeea1..d44e3274bc92 100644 --- a/widget/gonk/nsAppShell.cpp +++ b/widget/gonk/nsAppShell.cpp @@ -467,9 +467,18 @@ GeckoInputReaderPolicy::setDisplayInfo() "Orientation enums not matched!"); DisplayViewport viewport; - viewport.setNonDisplayViewport(gScreenBounds.width, gScreenBounds.height); viewport.displayId = 0; viewport.orientation = nsScreenGonk::GetRotation(); + viewport.physicalRight = viewport.deviceWidth = gScreenBounds.width; + viewport.physicalBottom = viewport.deviceHeight = gScreenBounds.height; + if (viewport.orientation == DISPLAY_ORIENTATION_90 || + viewport.orientation == DISPLAY_ORIENTATION_270) { + viewport.logicalRight = gScreenBounds.height; + viewport.logicalBottom = gScreenBounds.width; + } else { + viewport.logicalRight = gScreenBounds.width; + viewport.logicalBottom = gScreenBounds.height; + } mConfig.setDisplayInfo(false, viewport); }