Bug 36829 - [Qt] Send rotation directions when orientation change in Maemo5
Summary: [Qt] Send rotation directions when orientation change in Maemo5
Status: RESOLVED DUPLICATE of bug 50685
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Diego Gonzalez
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-03-30 08:49 PDT by Diego Gonzalez
Modified: 2011-02-23 10:45 PST (History)
8 users (show)

See Also:


Attachments
Proposed patch (5.49 KB, text/plain)
2010-03-30 13:48 PDT, Diego Gonzalez
no flags Details
html test case using onorientationchange event to show the device rotation directions (0, 90, -90 and 180 degrees) (3.79 KB, text/html)
2010-04-11 20:19 PDT, Diego Gonzalez
no flags Details
Send rotation events (6.05 KB, patch)
2010-04-11 20:23 PDT, Diego Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Gonzalez 2010-03-30 08:49:53 PDT
Expose API for WebCore::Frame::sendOrientationChangeEvent)
and (WebCore::Frame::orientation).

It is useful for mobile devices when the application wants
to inform Qt WebKit that the device orientation have been
changed and it will also invoke the onorientation event it
can be captured via JavaScript.
Comment 1 Diego Gonzalez 2010-03-30 09:00:04 PDT
(In reply to comment #0)
> Expose API for WebCore::Frame::sendOrientationChangeEvent)
> and (WebCore::Frame::orientation).
>

These methods have been implemented in bug #29508
Comment 2 Diego Gonzalez 2010-03-30 13:48:02 PDT
Created attachment 52077 [details]
Proposed patch
Comment 3 Simon Hausmann 2010-04-09 14:24:32 PDT
It doesn't feel right to me to add an API to QWebPage and bother third-party developers with it. Any change we can make this simply work out of the box?

If necessary using some platform specific code, unless there's already a signal somewhere in Qt (QApplication? QDesktopWidget?)
Comment 4 Kenneth Rohde Christiansen 2010-04-09 15:00:03 PDT
(In reply to comment #3)
> It doesn't feel right to me to add an API to QWebPage and bother third-party
> developers with it. Any change we can make this simply work out of the box?
> 
> If necessary using some platform specific code, unless there's already a signal
> somewhere in Qt (QApplication? QDesktopWidget?)

I gave the same comments on irc. Jesus tells me that there are Maemo specific events but they will only work in PR1.2
Comment 5 Diego Gonzalez 2010-04-11 20:13:48 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > It doesn't feel right to me to add an API to QWebPage and bother third-party
> > developers with it. Any change we can make this simply work out of the box?
> > 
> > If necessary using some platform specific code, unless there's already a signal
> > somewhere in Qt (QApplication? QDesktopWidget?)
> 
> I gave the same comments on irc. Jesus tells me that there are Maemo specific
> events but they will only work in PR1.2

Actually the maemo5 support for orientation will only work in PR1.2 is using setAttribute(Qt::WA_Maemo5AutoOrientation, true); it will provide a maemo application change the device orientation when the it is rotated from portrait to landscape and vice e versa.

Unfortunately, AFAIK the application does not send any event calling the orientation have been changed, of course it could be checked at resize but it could not be the best way. A possible way to get the directions when the device is rotated in maemo5 is getting this information from the accelerometer (Ariya gave me some examples). The other possible way could be using the lib qt mobility which seems has a API for it.
Comment 6 Diego Gonzalez 2010-04-11 20:19:45 PDT
Created attachment 53140 [details]
html test case using onorientationchange event to show the device rotation directions (0, 90, -90 and 180 degrees)
Comment 7 Diego Gonzalez 2010-04-11 20:23:47 PDT
Created attachment 53141 [details]
Send rotation events

An example how the rotation direction could be gotten using the orientation information from accelerometer
Comment 8 Kenneth Rohde Christiansen 2010-04-14 14:00:58 PDT
You want comments on this patch?
Comment 9 Diego Gonzalez 2010-04-14 14:51:27 PDT
(In reply to comment #8)
> You want comments on this patch?

Actually it is just an example how could we get orientation info from the accelerometer and send the rotation direction to webkit. The intention is show some possible ways to do this feature, so we can manage the best way to send these events.
Comment 10 Diego Gonzalez 2011-02-23 10:45:17 PST

*** This bug has been marked as a duplicate of bug 50685 ***