View Single Post
Posts: 2,006 | Thanked: 3,351 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#87
Originally Posted by f2thak View Post
Patience?? It should be simple.

I tried this multiple times and I got the same result...

Open the app, tilt my phone a bit and the screen rotates 180 degrees and stays there.........

edit: and this command doesnt work for me >> (killall qtaemon)
In X Terminal
killall qtaemon
doesn't work??? Strange, the program is /opt/usr/bin/qtaemon



Algorithm for determining orientation is:
Take (x*x+y*y)^(0.5)
Compare it with z
If z is larger, the orientation is 0, undetermined, because the device is practically on its back
If z is smaller, then:
compare absolute values of x and y
the largest of them determines whether it is portrait or landscape
take its sign
it determines whether you are in reverse orientation

When orientation changes and the new orientation isn't zero, rotate.

Rotation:
set the active window's flag "autorotate"
if new and old orientation have opposite signs, reverse the screen

Now, switching to portrait should depend only on built-in autorotation; the main function of qtaemon is to set autorotate flag to each window and to reverse the screen when needed.

Now, attached version sets the flag oftener, even when the orientation hasn't changed, because you could open a new window without changing orientation.

Hope it helps.

EDIT: And one more change: now orientation isn't set to zero, it's just unchanged, because setting to zero erases memory about current reverse-or-not orientation and might contribute to being stuck in reverse landscape. But don't expect wonders...
Attached Files
File Type: deb qtaemon_0.1.1_armel.deb (16.5 KB, 116 views)

Last edited by Wikiwide; 2010-11-17 at 04:02.
 

The Following 2 Users Say Thank You to Wikiwide For This Useful Post: