webOS Nation Forums >  Homebrew >  webOS patches > [patch] Slider Disables Browser Orientation Change
[patch] Slider Disables Browser Orientation Change

  Reply
 
LinkBack Thread Tools Display Modes
Old 11/28/2009, 07:15 PM   #1 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default [patch] Slider Disables Browser Orientation Change

Open the slider to lock the orientation (portrait or landscape) in the browser.

Close the slider to restart automatic orientation detection.


Update:
When you open a link in a new card while the slider is open, the new card will open in the same orientation as the existing cards.

If the slider is open when the browser is launched, the browser will be locked in portrait mode until the slider is closed.



Once a few people have tested it, I'll submit it to the feed.
Attached Files
File Type: patch keytoss-slider-orientation-block-2.patch (4.5 KB, 163 views) Email Attachment

Last edited by samkim; 11/29/2009 at 11:38 AM.
samkim is offline   Reply With Quote
Old 11/28/2009, 07:50 PM   #2 (permalink)
Member
 
Join Date: Oct 2005
Posts: 744
Likes Received: 0
Thanks: 63
Thanked 137 Times in 76 Posts
Default

you are a viking
a viking

ill try this out in a bit, doing some shuffling right now

I have no idea what working with the accelerator is like so excuse my naivete, but is there any way to simply disable it for all programs with a button or will that screw something up?
Stihl is offline   Reply With Quote
Old 11/28/2009, 08:05 PM   #3 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

Patch works great! Thanks
mamouton is offline   Reply With Quote
Old 11/29/2009, 12:00 AM   #4 (permalink)
Member
 
Join Date: May 2009
Posts: 1,142
Likes Received: 49
Thanks: 151
Thanked 286 Times in 147 Posts
Default

so far it's working as expect. thank you! this is a huge deal for me. do you have any plans on having this patch work for other apps aside from the browser?
__________________
--

Get your virtual onscreen keyboard themes & installation instructions here

Free 2GB of online storage, with automatic synching between multiple devices, on Dropbox
un_designer is offline   Reply With Quote
Old 11/29/2009, 04:56 AM   #5 (permalink)
Member
 
Rain of Lite's Avatar
 
Join Date: Nov 2009
Location: Eugene, Oregon
Posts: 35
Likes Received: 0
Thanks: 21
Thanked 2 Times in 2 Posts
Default

Yeah, having a toggle in the top bar menu would be awesome.
__________________
I heard a loud voice from the throne saying, “Behold, the dwelling place of God is with man. He will dwell with them, and they will be his people, and God himself will be with them as their God. He will wipe away every tear from their eyes, and death shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things have passed away.
Rain of Lite is offline   Reply With Quote
Old 11/29/2009, 05:40 AM   #6 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,883
Likes Received: 496
Thanks: 801
Thanked 12,956 Times in 1,495 Posts
Default

Quote:
Originally Posted by Rain of Lite View Post
Yeah, having a toggle in the top bar menu would be awesome.
Sadly not possible. Each app handles orientation changes in their own way and isn't globally controllable, as far as I know.



@samkim: nice patch
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Thanked By: Rain of Lite
Old 11/29/2009, 07:15 AM   #7 (permalink)
Member
 
Join Date: Jun 2009
Posts: 1,368
Likes Received: 57
Thanks: 585
Thanked 112 Times in 97 Posts
Default

Interesting idea and very well thought out...great work!!!

BTW, has anyone doing patches here or at web Internals released any notes on how they accomplished these patch tasks and changes?

On a Mac, I'd simply load Firebug or a CSS Editor and snope out where things are happening behind the scenes.

Just curious and either way keep up the great work.
sorli is offline   Reply With Quote
Old 11/29/2009, 08:32 AM   #8 (permalink)
Member
 
Join Date: Oct 2009
Location: London
Posts: 457
Likes Received: 1
Thanks: 59
Thanked 48 Times in 29 Posts
Default

This works great - thanks! Been looking for something like this for a while...
StevenX is offline   Reply With Quote
Old 11/29/2009, 08:55 AM   #9 (permalink)
Member
 
debilater's Avatar
 
Join Date: Nov 2009
Location: Germany
Posts: 145
Likes Received: 0
Thanks: 9
Thanked 59 Times in 23 Posts
Default

Cool, it works, Thanks for the work!
debilater is offline   Reply With Quote
Old 11/29/2009, 11:40 AM   #10 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Thanks all for the feedback.

I've rewritten the patch to add the following changes:
1. When you open a new card with the slider open, it will be in the same orientation as the current card.
2. If the slider is open when you launch the browser, it'll default to portrait mode.
samkim is offline   Reply With Quote
Old 11/29/2009, 11:59 AM   #11 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Quote:
Originally Posted by un_designer View Post
so far it's working as expect. thank you! this is a huge deal for me. do you have any plans on having this patch work for other apps aside from the browser?
I hadn't planned on it... The browser is the only app where I ran into problems with orientation changes. Is there another app where it's needed? (I don't know if I'll have the time anyway.)
samkim is offline   Reply With Quote
Old 11/29/2009, 12:04 PM   #12 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Quote:
Originally Posted by sorli View Post
Interesting idea and very well thought out...great work!!!

BTW, has anyone doing patches here or at web Internals released any notes on how they accomplished these patch tasks and changes?

On a Mac, I'd simply load Firebug or a CSS Editor and snope out where things are happening behind the scenes.

Just curious and either way keep up the great work.
I get the complete source code from webOS Doctor, and I edit with Coda on the Mac. I use Cornerstone (subversion app) to create the patch files. I have Terminal open with two tabs: one to restart Luna via ssh, and the other running palm-log for debugging.
samkim is offline   Reply With Quote
Old 11/29/2009, 10:50 PM   #13 (permalink)
Member
 
fritos1406's Avatar
 
Join Date: Jul 2009
Posts: 1,307
Likes Received: 1
Thanks: 34
Thanked 462 Times in 187 Posts
Default

hey this patch works great...very well thought, anyway u can make same function work for the messaging app.?
fritos1406 is offline   Reply With Quote
Old 11/30/2009, 01:10 PM   #14 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Quote:
Originally Posted by fritos1406 View Post
hey this patch works great...very well thought, anyway u can make same function work for the messaging app.?
Hey, thanks.

I see that you wrote the patch to use messaging in landscape. I don't use it, but my patch is open source under MIT license, so you're welcome to incorporate my code into your patch if you'd like.

Also, here's the original version of the patch - which is much easier to drop into another app. It's got four blocks: init, cleanup, new code, and an interrupt for the orientationChanged function.
Attached Files
File Type: patch keytoss-slider-orientation-block.patch (2.5 KB, 15 views) Email Attachment
samkim is offline   Reply With Quote
Old 12/02/2009, 01:52 AM   #15 (permalink)
Member
 
Join Date: Sep 2009
Posts: 13
Likes Received: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I've yet to mess around with patches for the Pre, but I have a little bit of coding experience. What would I do to drop this into the messaging app? The only references I see to the browser seem to be lines 2, 7, and 10 - Is this all I'd need to change for the messaging app? And if so, what is the name of the app file I should reference? com.palm.app.messaging, by any chance? Haha. (Surely it can't be that easy.)
vonstemmington is offline   Reply With Quote
Old 12/02/2009, 09:55 AM   #16 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

Quote:
Originally Posted by vonstemmington View Post
I've yet to mess around with patches for the Pre, but I have a little bit of coding experience. What would I do to drop this into the messaging app? The only references I see to the browser seem to be lines 2, 7, and 10 - Is this all I'd need to change for the messaging app? And if so, what is the name of the app file I should reference? com.palm.app.messaging, by any chance? Haha. (Surely it can't be that easy.)
A patch file describes the edits to make to existing code. My patches are in "unified diff" format, and they list:
1. the file(s) to edit
2. the line numbers affected and number of lines in each block before and after the edits are made
3. code to add (lines that start with a single "+")
4. code to remove (lines that start with a single "-")
5. code above and below the point of insertion or removal

To create a patch for another app, you'd need to edit the relevant file(s) in that app, and then use a special program to compare the original with the modified file to create the patch. I'm not familiar with the messaging app, but I think it should be easy for someone familiar with webOS to get my code to work in it.
samkim is offline   Reply With Quote
Old 12/02/2009, 08:30 PM   #17 (permalink)
Member
 
Join Date: Oct 2009
Posts: 74
Likes Received: 0
Thanks: 10
Thanked 30 Times in 20 Posts
Default Collaboration

I'm also working on a patch to enable/disable the auto-browser orientation. I haven't installed your patch but from the description you have provided, you're using a slider to change the settings.

The patch I've made uses an option in the preferences menu, which I think is a "smoother" way to set the browser orientation option.

Here's a screenshot of the normal browser preference page (left) and the patched browser preference page (right):



I refer to the setting as "Accelerometer" because essentially that's what the patch does, it turns on and off the accelerometer.

Instead of both of us submitting two patches to the feed that essentially do the same thing, I wanted to know if you would like to combine our efforts to make one patch.
__________________
hit up that thanks button
tjmarkham3 is offline   Reply With Quote
Thanked by cdawg62184, StevenX, Stihl
Old 12/02/2009, 08:55 PM   #18 (permalink)
Member
 
Join Date: Sep 2004
Posts: 1,233
Likes Received: 0
Thanks: 18
Thanked 165 Times in 45 Posts
Default

I submitted my patch several days ago. If you want to incorporate my patch code and feature into your patch, you're welcome to do so. And if that makes my patch unnecessary, we could remove it from the feed.

I personally would prefer controlling it with the slider, because it's much faster than launching a preferences page. But I'm sure many people would like a toggle switch, especially if they want to turn it off permanently. Also, Pixi owners don't have the option of using the slider.

I didn't call it the accelerometer because my patch only stops the browser from reacting. The accelerometer on the device is still running, and other apps will still respond to it.

If you've found a way to turn it off for the entire device, great. A lot of people want that.
samkim is offline   Reply With Quote
Old 12/03/2009, 10:54 AM   #19 (permalink)
Member
 
Join Date: Oct 2009
Location: London
Posts: 457
Likes Received: 1
Thanks: 59
Thanked 48 Times in 29 Posts
Default

A combined patch of these two methods would be pretty awesome I think - I'm looking forward to seeing the results if it happens!
StevenX is offline   Reply With Quote
Old 12/07/2009, 12:09 AM   #20 (permalink)
Member
 
grynv's Avatar
 
Join Date: Oct 2009
Location: CT
Posts: 149
Likes Received: 0
Thanks: 74
Thanked 47 Times in 17 Posts
Default

How about renaming the patch to:
Slider Locks Orientation
grynv is offline   Reply With Quote
Thanked By: samkim
Reply

 

Thread Tools
Display Modes


LinkBacks (?)
LinkBack to this Thread: http://forums.webosnation.com/webos-patches/217421-patch-slider-disables-browser-orientation-change.html
Posted By For Type Date
dBsooner's webOS-Patches Web Portal This thread Refback 05/06/2010 03:20 PM


 


Content Relevant URLs by vBSEO 3.6.0