Nokia N9/N950: Unlock the rotation of most stock applications

Most of the MeeGo 1.2 Harmattan stock applications in the Nokia N9 and the Nokia N950 are written using the libmeegotouch UI library. Libmeegotouch allows the orientation of the application to be locked so that it does not rotate freely when the device is rotated. When the Nokia N9 was chosen to be the only customer product released by Nokia, a decision was made to lock most of the applications to portrait to emphasize portrait as the primary device orientation and to minimize development effort. Unfortunately this was done on the UI library level so that there is no easy way to unlock the orientation.

This patch, written by Vesa Halttunen, changes libmeegotouch's MWindow::isOrientationAngleLocked() and MWindow::isOrientationLocked() so that instead of returning the locking value set by the application they return whether the application window's name or class matches one of the names or classes defined by the user in two GConf keys, /meegotouch/orientationlock/names and /meegotouch/orientationlock/classes. Both contain lists of strings, which can be set using GConfTool using the [value1,value2,value3] format. The patch also fixes the issue of windows not rotating to landscape on the N950 if the hardware keyboard is opened when the device is flat.

A pre-built libmeegotouchcore0 package for Harmattan PR1.3 is provided for those who want to try the patch out. When trying out the patch one should notice that the libmeegotouchcore0 package is installed from the com.nokia.maemo Aegis origin by default and cannot be replaced with a package from a less trusted source. Since force removing and reinstalling the package has the potential of rendering the device useless it is not recommended on a device which has a watchdog enabled. Incepting the package will work, but it should be noted that then the package becomes installed from com.nokia.maemo/local, which may cause problems if there will be an operating system update which includes libmeegotouchcore0.

After installation the orientation of all libmeegotouch applications will be unlocked (after they are restarted). Orientations of specific windows can be locked by setting their names to the /meegotouch/orientationlock/names GConf key as follows:

gconftool -s -t list --list-type=string /meegotouch/orientationlock/names "[Screen Lock]"

Window names can be checked with the xprop utility available in the x11-utils package:

# xprop WM_NAME
WM_NAME(STRING) = "Screen Lock"

Window classes can also be used by setting the classes of the windows to be orientation locked to the /meegotouch/orientationlock/classes key:

gconftool -s -t list --list-type=string /meegotouch/orientationlock/classes "[calc,clock]"

Window classes can also be checked with the xprop utility available in the x11-utils package:

# xprop WM_CLASS
WM_CLASS(STRING) = "calc", "Calc"

The patch checks whether either the name or the class of the class hint exists in the GConf key value.

Not all applications have been maintained to look as expected in landscape. In most cases this is only because the theme does not contain proper size/image definitions for landscape. This package contains additional theme files which fix some of the stock applications, such as Phone and Calculator. Music will work properly only in the orientation it was started in (because of a problem in the application itself). The alarm definition clock in the Clock application goes on top of other UI components in landscape but is still usable. Store and Music Store will only start in landscape if the physical keyboard (on the N950) is open. The package also contains a GConf schema for the patched libmeegotouch GConf keys and locks the orientation of those windows that do not work properly in landscape, like the touch screen lock and the call UI.

Use at your own risk! There is absolutely no warranty. The author takes no responsibility for problems, loss of data or loss of functionality caused by this patch. Also note that this unlocks Harmattan operating system functionality not supported in any way by Nokia. Do not file bugs to Nokia or to the author if you change the default home screen behavior.

Download