Closed Bug 533017 Opened 10 years ago Closed 10 years ago

Bring Fennec to the top when clicking on it from the hildon desktop

Categories

(Firefox for Android Graveyard :: General, defect)

Fennec 1.1
ARM
Maemo
defect
Not set

Tracking

(status1.9.2 final-fixed, fennec1.0+)

RESOLVED FIXED
Tracking Status
status1.9.2 --- final-fixed
fennec 1.0+ ---

People

(Reporter: pavlov, Assigned: mfinkle)

References

Details

Attachments

(1 file, 3 obsolete files)

Because we have the X-Osso-Service in our .desktop file, rather than our exec being called our application receives a top_application dbus message, which we don't currently handle.  I believe we we need to simply setup osso_application_set_top_cb per http://maemo.org/api_refs/5.0/5.0-final/libosso/ docs, and run some code similar to http://mxr.mozilla.org/mobile-browser/source/components/BrowserCLH.js#55 in our callback
tracking-fennec: --- → 1.0+
Attached patch WIP 1 (obsolete) — Splinter Review
I think this is what stuart has in mind. I need to test this to make sure the commandline is passed and the BrowserCLH.js code is executed correctly.
Assignee: nobody → mark.finkle
Attached patch patch (obsolete) — Splinter Review
This patch implements the dbus rpc callback on maemo. The patch handles "top_application" which occurs when a shortcut is used to start an app and it handles "launch_url" and "open_new_window" which pass arguments.

Arguments are converted to nsCommandLine-friendly types. BrowserCLH.js handles both cases (arguments or no arguments) and will focus the running window, optionally opening new tabs based on the any arguments.

This is a Maemo only change
Attachment #416247 - Attachment is obsolete: true
Attachment #416714 - Flags: review?(pavlov)
You can test "load_url" using this command line:

dbus-send --system --type=method_call --dest="mozilla.fennec" --print-reply /mozilla/fennec/request mozilla.fennec.load_url string:"http://ebay.com"
Attachment #416714 - Flags: review?(pavlov) → review+
Attached patch patch 2 (obsolete) — Splinter Review
While doing more testing, I found that handling "top_application" in commandline handlers had the bad side effect of opening two (2) windows when launching from desktop. Launching from commandline (symlink or real binary) did not open two windows. The "top_application" method is fired by dbus on startup and was causing nsDefaultCLH to open a second Fennec window.

To work around this, the new patch treats the "top_application" method internally - it does not pass it off to the commandline handlers. We just focus the topmost Fennec window, which brings the application to the front.

Other methods are still passed off to the commandline handlers, since we have some use cases for supporting other methods.
Attachment #416714 - Attachment is obsolete: true
Attachment #416874 - Flags: review?(pavlov)
Attachment #416874 - Flags: review?(pavlov) → review+
Blocks: 533974
Attached patch pushed patchSplinter Review
Pushed the patch with an addition which was IRL r+ by DougT

It added a check for the "quit" method
Attachment #416874 - Attachment is obsolete: true
Attachment #416975 - Flags: approval1.9.2?
Attachment #416975 - Flags: approval1.9.2? → approval1.9.2+
pushed m-192:
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/8df91edf9ecd
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
Component: Linux/Maemo → General
OS: All → Linux (embedded)
QA Contact: maemo-linux → general
Hardware: All → ARM
You need to log in before you can comment on or make changes to this bug.