maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   [Patch] Unlock the rotation of most stock applications (https://talk.maemo.org/showthread.php?t=85425)

Vesuri 2012-07-11 10:20

[Patch] Unlock the rotation of most stock applications
 
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.

Morpog 2012-07-11 14:47

Re: [Patch] Unlock the rotation of most stock applications
 
Sounds like incepting it could do the trick to preserve the com.nokia.maemo origin. Anyone going to try out? :D

HtheB 2012-07-11 14:59

Re: [Patch] Unlock the rotation of most stock applications
 
Vesuri, did you already tried out incepting it first?

Vesuri 2012-07-11 17:22

Re: [Patch] Unlock the rotation of most stock applications
 
Quote:

Originally Posted by HtheB (Post 1236065)
Vesuri, did you already tried out incepting it first?

It works, but that changes the origin to com.nokia.maemo/local which can cause problems if there ever will be an OS upgrade which contains libmeegotouchcore0.

Hariainm 2012-07-11 18:48

Re: [Patch] Unlock the rotation of most stock applications
 
This is great! Video anyone, please?

aironeous 2012-07-11 19:21

Re: [Patch] Unlock the rotation of most stock applications
 
This is great as the stock apps that won't do landscape are quite annoying.

godofwar424 2012-07-11 19:30

Re: [Patch] Unlock the rotation of most stock applications
 
Quote:

Originally Posted by aironeous (Post 1236259)
This is great as the stock apps that won't do landscape are quite annoying.

Facebook and twitter!

Vesuri 2012-07-11 20:30

Re: [Patch] Unlock the rotation of most stock applications
 
Quote:

Originally Posted by godofwar424 (Post 1236262)
Facebook and twitter!

Unfortunately those are not libmeegotouch applications and will not benefit from this patch. Sorry. :(

Vesuri 2012-07-11 20:36

Re: [Patch] Unlock the rotation of most stock applications
 
I'm also working on a theme package which adds landscape theming for those stock applications that have not been maintained in landscape.

Quote:

Originally Posted by Hariainm (Post 1236242)
This is great! Video anyone, please?

No video, but here's a screenshot of Phone running in landscape with the theme package installed. The layout is not perfect but at least it's usable:

http://vesuri.jormas.com/harmattan/m...cape-phone.png

Also, here's the Calculator in landscape:

http://vesuri.jormas.com/harmattan/m...calculator.png

Clock:

http://vesuri.jormas.com/harmattan/m...cape-clock.png

Music:

http://vesuri.jormas.com/harmattan/m...musicsuite.png

Settings:

http://vesuri.jormas.com/harmattan/m...e-settings.png

Store:

http://vesuri.jormas.com/harmattan/m...e-ovistore.png

Music Store:

http://vesuri.jormas.com/harmattan/m...musicstore.png

The patch, the pre-built libmeegotouch, the theme package and more information can be found from http://vesuri.jormas.com/harmattan/libmeegotouch.html.

eennbb 2012-07-13 06:54

Re: [Patch] Unlock the rotation of most stock applications
 
in pr1.3?????


All times are GMT. The time now is 12:11.

vBulletin® Version 3.8.8