-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible Error in code of orientation #36
Comments
-----BEGIN PGP SIGNED MESSAGE----- I'll take a look shortly. peter On 04/16/2015 05:03 AM, z0mb0lix wrote:
iQEcBAEBAgAGBQJVL8WtAAoJECjN6+QThfjzSFMH/2B2Dst2s2UtsHw2aqid/WE2 |
-----BEGIN PGP SIGNED MESSAGE----- Yes, your analysis is correct. I wonder how that bug got into the code. I made the change, and pushed it back to the repository. Thanks for doing the hard work to figure out what was going wrong. I also pushed a change to where some keyboard stuff is put, as Fedora 21 peter On 04/16/2015 05:03 AM, z0mb0lix wrote:
iQEcBAEBAgAGBQJVL+E6AAoJECjN6+QThfjzDakIAJve45eau9EvjgaMrOsWu5Vd |
Hey pfps.
I am almost certain I found a small error in your orientation.c code that prevents the auto rotation:
406 if (previous_orientation == orientation /* only rotate when stable */ && orientation !=
407 screen_orientation && orientation != FLAT && !orientation_lock) {
408 rotate_to(orientation);
409 previous_orientation = orientation;
410
411 }
In line 406 the dependencies to execute the rotate_to - section are defined as
if (previous_orientation == orientation /* only rotate when stable */ &&
orientation != screen_orientation && orientation != FLAT && !orientation_lock)
If I understand it correct, the value of previous_orientation is defined as "-1" in the header section and gets a new value at two positions:
BUT, here comes the clue: screen_orientation also only gets his value in the rotate_to sequence.
But that prevents the section from actually running because the algorithms to set the values to fulfil the dependencies are only executed AFTER the dependencies are fulfilled.
It SHOULD (imo) set the value of previous_orientation after each time the check orientation process is finished.
So.. long story short: I think the previous_orientation=orientation command should be taken out of the sequence above and placed as a dependencie-free command behind the rest
Something like this:
406 if (previous_orientation == orientation /* only rotate when stable */ && orientation !=
407 screen_orientation && orientation != FLAT && !orientation_lock) {
408 rotate_to(orientation);
409
410 }
411 previous_orientation = orientation;
I tried it with this code and if "run sequence once" - write previous_orientation at the end after all other commands - "run sequence again" - previous_orientation=orientation at the beginning - Hurray!
Greetings
Felix
The text was updated successfully, but these errors were encountered: