Ideal screen rotation

Neil Jerram neiljerram at googlemail.com
Sat Nov 7 15:23:01 CET 2009


2009/11/7 Rui Miguel Silva Seabra <rms at 1407.org>:
>
> I'm definitely not following you... I envision the following scenario according
> to what you say, could you please elaborate on why it wouldn't happen this way?

My thinking is evolving with this discussion, but my current idea of
the solution is that the WM controls whether omnewrotate is running
(or equivalent, but for simplicity let's just say omnewrotate).

So for the current foreground app, the WM determines (from properties,
or width:height, or configuration, or some customization hook, or from
user direction via a shelf gadget) which of the following applies.

1. App works best in landscape.
2. App works best in portrait.
3. App can adapt to either landscape or portrait, and user should
choose by turning the phone round.

Then, for (1) and (2), the WM itself calls xrandr to set the correct
orientation, and kills omnewrotate if it was running.  For (3) the WM
starts omnewrotate if it isn't already running, and omnewrotate then
handles autorotation.

Given that...

>  1. App wants to be landscape, sets property on window

WM would call xrandr itself.

>  2. "rotator" determines the phone is in portrait, rotates.

omnewrotate wouldn't be running, so this wouldn't happen.

> Now what happens?
>
>  3. App is landscape, but screen is portrait: fail

WM calls xrandr to go to landscape.

> or
>
>  3. Window manager overrides rotation
>  3.1 but "rotator" determines portrait, rotates again

As above, omnewrotate wouldn't actually be running, so wouldn't do this.

I hope that helps to clarify what I have in mind!

Regards,
       Neil



More information about the community mailing list