Closed Bug 533017 Opened 10 years ago Closed 10 years ago
Bring Fennec to the top when clicking on it from the hildon desktop
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
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
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
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+
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 #416874 - Flags: review?(pavlov) → review+
Pushed the patch with an addition which was IRL r+ by DougT It added a check for the "quit" method
Attachment #416975 - Flags: approval1.9.2? → approval1.9.2+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
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.