Patch Email Enable Landscape Viewing

From WebOS Internals
Jump to navigation Jump to search


This will enable landscape mode for email so that using the keyboard entered code to enable it per session will not be needed.

Procedure for 1.1

From Email Landscape Patch, it is indicated certified working on 1.1 but not to be applied to versions prior to 1.1. If the author grants permission to duplicate it here please do so.

Procedure prior to 1.1

Enabling rotation in email is trivial. Whenever you rotate the device, the system calls the orientationChanged function of the app. There's already one defined in email, but for some reason it does nothing. You can enable rotation by applying the following patches.

NOTE: The root of the patches is /usr/palm/applications/

You will need write permissions to the file system on your Pre to apply this patch.

To get write persmissions execute:

rootfs_open -w

After you've made the changes below, remount the file system as read-only:

mount -o remount,ro /


--- list-assistant.js_2009-06-27	Sat Jun 27 19:19:19 2009
+++ list-assistant.js	Sat Jun 27 20:03:19 2009
@@ -27,6 +27,9 @@
 				{label:$L('Update'), icon:'sync', command:'sync'}
 	this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
   // NOTE: this is called by app_scene's _setup function


--- compose-assistant.js_2009-06-27	Sat Jun 27 19:21:43 2009
+++ compose-assistant.js	Sat Jun 27 20:03:45 2009
@@ -178,6 +178,9 @@
 		// Delayed a little, since we want the header part of render as quickly as possible
+		// enable free orientation
+		this.controller.window.PalmSystem.setWindowOrientation("free");
 	cleanup: function() {


--- accounts-assistant.js_2009-06-27	Sat Jun 27 19:29:47 2009
+++ accounts-assistant.js	Sat Jun 27 20:01:28 2009
@@ -51,6 +51,9 @@
 		EmailAppDepot.depot.isShowFavorites(AccountsAssistant.kFavoriteFoldersAccountID, this.depotGetFavExpanded.bind(this));
 		this.controller.listen(this.controller.sceneElement, Mojo.Event.keypress, this.keypressHandler.bind(this));
+		// enable free orientation                                                 
+                this.controller.window.PalmSystem.setWindowOrientation("free");
 	cleanup: function() {


Credit goes to jblebrun for the original hack.

Seems that the menu disappears in landscape mode and that the orientation mode carries over from one part of the app to the other as you move to a message or back to the message list or account list. This is especially weird in the compose screen since the menu has some needed functionality in it ~ FXDemolisher

Curious item found in accounts-assitant.js. There seems to be an orientationString variable in the controller that is linked to some kind of hack if you type a specific string while having the account(folder) list open. Will investigate further.

UPDATE: Seems that typing "RocknRollHax" (see ./app/controllers/accounts-assistant.js) in the accounts list window will cause the email app to go into 'free' orientation mode. Looks like its an easier way to perform orientation changes instead of explicitly calling setWindowOrientation whenever the orientation changes. Doesnt work

Alternate to RocknRollHax: In accounts-assistant.js, change key word in line 106 to 'wide' or whatever you want. Change string length in line 104 to num characters of your new key word. - xorg

- FXDemolisher

7/25/2009 With webOS 1.1 you can type "wide" to activate this feature w/o editing any files. However it is not persistent between application launches.

Only the accounts-assistant.js file needs to be patched in webOS 1.1. The compose-assistant.js edit needs work as it currently does not work in webOS 1.1.