View Single Post
Posts: 123 | Thanked: 457 times | Joined on Feb 2012
#1
Most of the MeeGo 1.2 Harmattan stock applications (excluding a few like Facebook, Twitter, AccuWeather, Maps and Drive) 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. Most of the applications are locked to portrait to emphasize portrait as the primary device orientation. Unfortunately this is done on the UI library level so that there is no easy way to unlock the orientation.

This patch, available from http://vesuri.jormas.com/harmattan/libmeegotouch.html, 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.

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.

Since many of the stock applications have not been maintained to work in landscape, an additional theme package is provided to add landscape theming for those stock applications that have not been maintained in landscape.

As always, 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 QML applications like Facebook and Twitter do not benefit from this patch.

Last edited by Vesuri; 2012-08-14 at 09:47.
 

The Following 53 Users Say Thank You to Vesuri For This Useful Post: