browser-switch
12 years agoAlso register for path / on D-Bus master
Steven Luo [Sun, 7 Aug 2011 00:22:59 +0000 (17:22 -0700)]
Also register for path / on D-Bus

This lets us work with broken applications like the Fremantle xterm
which direct their D-Bus requests to this path instead of
/com/nokia/osso_browser like they should.

Thanks to t.m.o users laasonen for reporting and Anzah for providing
diagnostic output leading to a fix.

13 years agoUse computed offset instead of hand-built array for access to struct swb_config members
Steven Luo [Sun, 28 Nov 2010 14:14:17 +0000 (06:14 -0800)]
Use computed offset instead of hand-built array for access to struct swb_config members

To access an arbitrary member of struct swb_config, we currently use the
entries array in the struct, which contains pointers to the members of
the struct in order.  This has several disadvantages:

* the entries array must be filled by hand for each instance;
* structure instances cannot be copied in the normal way;
* the swb_config_options array describing the possible config options
  must be kept in the same order as the members of the struct.

A much better solution is to let the compiler compute the offset of
structure members using the offsetof() macro and stick the results in
the swb_config_options array; we can then access the member by adding
the offset to the address of the structure instance.  This also allows
us to get rid of the entries array in struct swb_config and the
swb_config_copy() function.

13 years agoMake signal handlers async-signal-safe
Steven Luo [Sun, 28 Nov 2010 12:11:09 +0000 (04:11 -0800)]
Make signal handlers async-signal-safe

Signal handlers can be invoked at any time during program execution,
including when global data is in an inconsistent state.  Therefore,
signal handlers must not modify global data without the volatile
sig_atomic_t qualifier and must not call functions outside the
async-signal-safe set; invoking a signal handler which breaks these
rules during the execution of an async-signal-unsafe function results in
undefined behavior.

All of our signal handlers currently violate these rules.

The SIGCHLD handler is easy to fix -- remove the unsafe log_msg() call,
which has outlived its usefulness anyway.

We fix the SIGHUP handler by moving the work of rereading the config
file out of signal handler context and into the main loop.  In the new
design, the process opens a pipe, the read end of which is polled in the
GLib event loop.  The signal handler writes the signal number to the
write end of the pipe, which causes the event loop to dispatch a request
to reread the config file.  It's possible to handle other signals using
the same infrastructure by teaching the dispatcher other signals.

13 years agoUpdate webpage
Steven Luo [Sun, 3 Oct 2010 04:03:07 +0000 (21:03 -0700)]
Update webpage

The one-click install works on Fremantle too, not just Diablo -- fix a
place in the text that suggested otherwise.

13 years agoUpdate webpage, provide Fremantle install file
Steven Luo [Fri, 1 Oct 2010 03:09:00 +0000 (20:09 -0700)]
Update webpage, provide Fremantle install file

Now that Browser Switchboard has reached Fremantle extras, recommend
that users install it from extras and provide an install file for them.

13 years agoUpdate Fremantle screenshot
Steven Luo [Fri, 1 Oct 2010 02:56:36 +0000 (19:56 -0700)]
Update Fremantle screenshot

We revised the UI to get rid of the continuous mode switch -- update
screenshot to match.

13 years agoWhitespace fixes
Steven Luo [Sat, 25 Sep 2010 05:54:09 +0000 (22:54 -0700)]
Whitespace fixes

13 years agoProvide open_new_window and load_url methods with boolean fullscreen argument
Steven Luo [Sat, 25 Sep 2010 02:33:42 +0000 (19:33 -0700)]
Provide open_new_window and load_url methods with boolean fullscreen argument

MicroB implements an optional boolean argument to the open_new_window
and load_url methods in the com.nokia.osso_browser interface, which
allows the application to request that the new page be loaded in a
fullscreen window.  We need to provide this as well -- otherwise,
applications that use the argument will receive an error.

Provide versions of open_new_window and load_url with a fullscreen
argument, which is ignored for the moment.  It's not going to be
possible to implement the fullscreen behavior for all supported
browsers, but we should implement it for MicroB, at least.

Fixes the launching of the Flickr new account page from the Sharing
control panel in Fremantle:
https://garage.maemo.org/tracker/index.php?func=detail&aid=6444&group_id=1159&atid=4348
Thanks to Tom G for reporting.

13 years agoUpdate webpage
Steven Luo [Sat, 11 Sep 2010 23:42:27 +0000 (16:42 -0700)]
Update webpage

13 years agoFremantle: Make DBusGProxy static in launch_microb_open_window()
Steven Luo [Wed, 8 Sep 2010 07:20:39 +0000 (00:20 -0700)]
Fremantle: Make DBusGProxy static in launch_microb_open_window()

Chances are good we'll need to use the D-Bus proxy again at some point,
so instead of getting rid of it when launch_microb_open_window()
finishes, save it for later use.

Has the side effect of fixing a leak when we open a bookmarks window.

13 years agoFremantle: Use open_new_window instead of load_url when passing URL to MicroB
Steven Luo [Wed, 8 Sep 2010 06:34:31 +0000 (23:34 -0700)]
Fremantle: Use open_new_window instead of load_url when passing URL to MicroB

With the changes to MicroB launching for Fremantle, there are now cases
where we are passing a D-Bus request to a MicroB process with windows
open, instead of just asking for a browser session to be started.  In
the latter case, load_url and open_new_window are equivalent, but in the
former, they are not -- load_url loads the URL in an existing browser
window.

Fully emulating MicroB's behavior here now requires keeping track of
whether the request we got was load_url or open_new_window and
requesting the same of MicroB, but for now, do what most users want and
what we do with other browsers -- always open a new window for the URL.

13 years agoUpdate webpage
Steven Luo [Fri, 3 Sep 2010 07:30:09 +0000 (00:30 -0700)]
Update webpage

13 years agoUpdate README
Steven Luo [Fri, 3 Sep 2010 04:35:46 +0000 (21:35 -0700)]
Update README

Neglected to mention Opera in the description.

13 years agoRestore webpages
Steven Luo [Fri, 3 Sep 2010 04:34:22 +0000 (21:34 -0700)]
Restore webpages

13 years agoRemove webpages for release v3.3
Steven Luo [Fri, 3 Sep 2010 04:29:47 +0000 (21:29 -0700)]
Remove webpages for release

13 years agoUpdate README
Steven Luo [Fri, 3 Sep 2010 04:07:22 +0000 (21:07 -0700)]
Update README

13 years agoUpdate webpage
Steven Luo [Sat, 28 Aug 2010 15:15:53 +0000 (08:15 -0700)]
Update webpage

Users looking for beta packages for Fremantle (as opposed to development
releases) should use extras-testing, not extras-devel.

13 years agoRestore webpages
Steven Luo [Sat, 28 Aug 2010 11:48:34 +0000 (04:48 -0700)]
Restore webpages

13 years agoRemove webpages for release v3.3b2
Steven Luo [Sat, 28 Aug 2010 11:46:35 +0000 (04:46 -0700)]
Remove webpages for release

13 years agoMake sure we don't try to free a random element of cfg in set_config_value()
Steven Luo [Sat, 28 Aug 2010 11:22:50 +0000 (04:22 -0700)]
Make sure we don't try to free a random element of cfg in set_config_value()

13 years agoUpdate Changelog
Steven Luo [Sat, 28 Aug 2010 11:07:49 +0000 (04:07 -0700)]
Update Changelog

13 years agoUpdate README, document changes in 3.3 betas
Steven Luo [Sat, 28 Aug 2010 10:29:56 +0000 (03:29 -0700)]
Update README, document changes in 3.3 betas

13 years agoCommand-line utility: avoid double free()s when modifying config option
Steven Luo [Sat, 28 Aug 2010 08:30:31 +0000 (01:30 -0700)]
Command-line utility: avoid double free()s when modifying config option

13 years agoAdd install target for Fremantle Xsession.post script to Makefile
Steven Luo [Sat, 28 Aug 2010 04:03:49 +0000 (21:03 -0700)]
Add install target for Fremantle Xsession.post script to Makefile

13 years agoFremantle: Prestart MicroB if appropriate when reconfiguring browser-switchboard
Steven Luo [Sat, 28 Aug 2010 03:42:18 +0000 (20:42 -0700)]
Fremantle: Prestart MicroB if appropriate when reconfiguring browser-switchboard

If, in changing the browser-switchboard configuration, we go from a
configuration where MicroB is not left running to one where it is, we
should start MicroB in the background in order to make sure that the
MicroB browser window comes up quickly when requested.  Make a
best-effort attempt at this in both the command-line utility and the
GUI, refactoring to give a swb_reconfig() function that can be shared
between the two along the way.

Ideally, we'd also kill MicroB when making a config change in the other
direction, but we don't have an easy way of knowing whether MicroB is
actually in use and we don't want to kill MicroB if it's in use at the
time.

13 years agoAdd an Xsession.post script for Fremantle to launch browser-switchboard on session...
Steven Luo [Sat, 28 Aug 2010 03:47:29 +0000 (20:47 -0700)]
Add an Xsession.post script for Fremantle to launch browser-switchboard on session startup

Fremantle MicroB autostarts by default and listens on both the D-Bus
system and session buses, so applications may send requests on either
bus (even though those that send requests on the system bus should be
fixed).  We therefore need to duplicate this behavior, but we cannot
rely on D-Bus to launch us to handle a request coming in on the system
bus, since the system bus runs as the "messagebus" user, and we need to
run with the UID of the logged-in user.  A complete fix for Browser
Switchboard bug 5910 ("browser-switchboard should listen on D-Bus system
bus as well") on Fremantle therefore requires that browser-switchboard
be autostarted when the desktop environment comes up.

We arrange for this the same way browserd does on Fremantle -- with an
Xsession.post script that runs on X session startup.  Also, we prestart
MicroB if the current browser-switchboard configuration is to leave it
running in the background, to make opening the first MicroB window
faster.

Because we may start the MicroB browser process, this script needs to
be inserted after browserd's in the Xsession.post run order.

13 years agoFix /usr/bin/microb script to work with new Fremantle MicroB launching code
Steven Luo [Fri, 27 Aug 2010 14:01:43 +0000 (07:01 -0700)]
Fix /usr/bin/microb script to work with new Fremantle MicroB launching code

The new Fremantle MicroB launching code breaks the assumption in the
microb script that the existence of the MicroB browser process implies
that MicroB is handling com.nokia.osso_browser.  Revise the script to
check directly whether Browser Switchboard is handling that name, by
comparing its owner to that of org.maemo.garage.browser-switchboard
(using the org.freedesktop.DBus.GetNameOwner method).

13 years agoMake sure to initialize the DBusError in microb_start_dbus_watch_remove()
Steven Luo [Fri, 27 Aug 2010 11:13:26 +0000 (04:13 -0700)]
Make sure to initialize the DBusError in microb_start_dbus_watch_remove()

13 years agoFremantle: Coexist with a running MicroB process; don't kill MicroB at end of session...
Steven Luo [Sun, 30 May 2010 07:58:08 +0000 (00:58 -0700)]
Fremantle: Coexist with a running MicroB process; don't kill MicroB at end of session if MicroB is the default browser

With commit aeb836f5... ("Tweak detection of com.nokia.osso_browser
acquisition slightly"), it's almost possible to support opening a new
window in an already-running MicroB.  All we have to do is avoid
invoking a new browser process in that case, so do that here.

It also turns out to be possible to take back the com.nokia.osso_browser
D-Bus name from MicroB without killing it, which is interesting to us
because the need to kill MicroB is what necessitates the behavior
changes we force on MicroB.

On the other hand, if we choose to avoid killing MicroB, we lose the
ability to have MicroB take over handling osso_browser requests while a
MicroB window is open, and we waste memory for users who aren't using
MicroB very often.

Therefore, we take a compromise approach: if MicroB is set as the
default browser, we don't bother killing MicroB when the last browser
window closes (which simplifies the code considerably, since we no
longer need to monitor MicroB while it's running, and also means that
MicroB should behave as it does when browser-switchboard isn't running).
Otherwise, we act as before (watch the running MicroB and kill it when the
last browser window closes, with the behavior changes this requires).

For control freaks, there's also a new autostart_microb config option
which allows you to override this heuristic.  Setting autostart_microb
to 0 forces us to kill MicroB even when MicroB is the configured default
browser, and setting it to 1 forces us to leave MicroB running even when
MicroB isn't the default.

13 years agoRefactor Fremantle launch_microb code
Steven Luo [Mon, 24 May 2010 09:39:03 +0000 (02:39 -0700)]
Refactor Fremantle launch_microb code

Split out code that will be shared with the new code to launch a window
in an already-existing MicroB process to separate functions, and move
the rest of the existing hairball into a new
launch_microb_fremantle_with_kill() to make it easier to plug the
forthcoming launch_microb_fremantle() in.

13 years agoTweak detection of com.nokia.osso_browser acquisition slightly
Steven Luo [Mon, 8 Mar 2010 09:01:23 +0000 (01:01 -0800)]
Tweak detection of com.nokia.osso_browser acquisition slightly

Instead of looking for an empty old owner string, look for a nonempty
new owner string -- this picks up cases where ownership changes hands as
well as cases where a previously unowned name is acquired.

13 years agoWhitespace fixes
Steven Luo [Fri, 27 Aug 2010 10:23:25 +0000 (03:23 -0700)]
Whitespace fixes

13 years agoCommand-line utility: check that browser is installed before reporting it as the...
Steven Luo [Fri, 27 Aug 2010 10:19:52 +0000 (03:19 -0700)]
Command-line utility: check that browser is installed before reporting it as the default

When reporting the configured default browser (-b), check to see that
it's installed.  If the configured default browser isn't installed,
report the default default browser instead, since that's what
browser-switchboard will actually use.

13 years agoConfig UI: Only offer the user browsers that are installed
Steven Luo [Fri, 27 Aug 2010 09:57:52 +0000 (02:57 -0700)]
Config UI: Only offer the user browsers that are installed

Check to see which of the known browsers is installed, and only offer
the user choices for the ones that are.  If the currently configured
default browser is not installed (e.g. if the user uninstalled the
browser without changing the default), use the default default browser
like browser-switchboard does.

This fixes Browser Switchboard bug 5469:
https://garage.maemo.org/tracker/index.php?func=detail&aid=5469&group_id=1159&atid=4348

13 years agoEliminate trailing whitespace from lines
Steven Luo [Thu, 26 Aug 2010 12:39:20 +0000 (05:39 -0700)]
Eliminate trailing whitespace from lines

13 years agoAdd trailing newline to Fremantle continuous mode warning message
Steven Luo [Thu, 26 Aug 2010 12:07:59 +0000 (05:07 -0700)]
Add trailing newline to Fremantle continuous mode warning message

13 years agoTreat failure to acquire osso_browser name on system bus as non-fatal
Steven Luo [Thu, 26 Aug 2010 11:33:21 +0000 (04:33 -0700)]
Treat failure to acquire osso_browser name on system bus as non-fatal

This makes testing on regular Linux systems (where the system bus is
restricted to privileged processes) easier.

13 years agoListen on D-Bus system bus as well as session bus
Steven Luo [Thu, 26 Aug 2010 02:28:11 +0000 (19:28 -0700)]
Listen on D-Bus system bus as well as session bus

Discussion on https://bugs.maemo.org/show_bug.cgi?id=8369 (Hermes
doesn't work when Browser Switchboard is installed) revealed that
MicroB listens on the D-Bus system bus as well as the session bus.
While it's not appropriate for applications to request opening a
browser via the system bus (which is supposed to be for requesting
system services, not applications), the fact that MicroB listens
there means that we need to too.

This fixes Browser Switchboard bug 5910.  Thanks to Andrew Flegg and
Marcin Juszkiewicz for providing the information needed to track down
this bug.

13 years agoRemove continuous_mode config option from Fremantle UI
Steven Luo [Thu, 26 Aug 2010 01:18:28 +0000 (18:18 -0700)]
Remove continuous_mode config option from Fremantle UI

Now that we force continuous_mode on for Fremantle, there's no point
in having the setting exposed in the UI.  Remove it.

13 years agoForce continuous_mode on on Fremantle
Steven Luo [Thu, 26 Aug 2010 01:10:48 +0000 (18:10 -0700)]
Force continuous_mode on on Fremantle

For Fremantle, we have to have continuous_mode on in order to keep
listening to the D-Bus system bus like MicroB does.  Since several
applications appear to depend on this behavior, force continuous_mode
on for Fremantle and emit a warning if the config file has it turned
off.

13 years agoMake continuous mode operation the default
Steven Luo [Thu, 26 Aug 2010 01:01:58 +0000 (18:01 -0700)]
Make continuous mode operation the default

Continuous mode is better-tested at this point, and the ~100 KB
memory footprint isn't an issue on Maemo devices.  Moreover, a full
fix for bug 5910 (listen on D-Bus system bus as well as session bus)
on Fremantle requires continuous mode.

13 years agoRemove unnecessary break statement in swb_config_load_option()
Steven Luo [Thu, 26 Aug 2010 11:58:36 +0000 (04:58 -0700)]
Remove unnecessary break statement in swb_config_load_option()

13 years agoSimplify control flow in swb_config_load_option()
Steven Luo [Thu, 26 Aug 2010 11:49:20 +0000 (04:49 -0700)]
Simplify control flow in swb_config_load_option()

Just return out of the loop when a match is found, and get rid of the
retval variable.

13 years agoFix memory leak when repeated options are encountered in config file
Steven Luo [Thu, 26 Aug 2010 11:43:15 +0000 (04:43 -0700)]
Fix memory leak when repeated options are encountered in config file

Caught by valgrind.

13 years agoAdd command-line utility to Makefile install target
Steven Luo [Sun, 30 May 2010 09:46:46 +0000 (02:46 -0700)]
Add command-line utility to Makefile install target

13 years agoRestore webpages
Steven Luo [Sun, 30 May 2010 09:38:26 +0000 (02:38 -0700)]
Restore webpages

This reverts commit 8cb71fe8a77dc9a723232c815ee4457da3fb4103.

13 years agoRemove webpages for release v3.3b1
Steven Luo [Sun, 30 May 2010 09:37:56 +0000 (02:37 -0700)]
Remove webpages for release

13 years agoConfig UI: leave other_browser_cmd unset instead of configuring an empty value
Steven Luo [Sun, 30 May 2010 09:17:11 +0000 (02:17 -0700)]
Config UI: leave other_browser_cmd unset instead of configuring an empty value

It used to be that when the user cleared the value of other_browser_cmd
in the UI, the setting would be removed from the config file instead of
writing an empty value.  Restore this behavior.

13 years agoFix check for whether a browser is installed
Steven Luo [Sun, 30 May 2010 08:54:25 +0000 (01:54 -0700)]
Fix check for whether a browser is installed

The intent was to exempt MicroB (and any other browser listed with
browser->binary = NULL) from the check, but the tests here didn't do
that.  Fix this so that default_browser = microb doesn't emit a warning.

13 years agoCommand-line utility: avoid NULL dereference when displaying string config settings
Steven Luo [Sun, 30 May 2010 08:51:42 +0000 (01:51 -0700)]
Command-line utility: avoid NULL dereference when displaying string config settings

13 years agoUpdate README and Changelog
Steven Luo [Sun, 30 May 2010 08:09:37 +0000 (01:09 -0700)]
Update README and Changelog

13 years agoFix memory leak on reconfiguration
Steven Luo [Sun, 30 May 2010 07:48:37 +0000 (00:48 -0700)]
Fix memory leak on reconfiguration

Caught by valgrind.

13 years agoDescribe MicroB slightly more verbosely in the UI
Steven Luo [Sun, 30 May 2010 07:16:32 +0000 (00:16 -0700)]
Describe MicroB slightly more verbosely in the UI

Emanuele Cassioli pointed out that users could potentially be unfamiliar
with the name "MicroB", since it's not used in normally user-visible
places.  Rename the entry "MicroB (stock browser)" to hopefully help
these users; better suggestions welcome.

13 years agoDon't use a browser as the default browser if it's not installed
Steven Luo [Sun, 30 May 2010 05:53:19 +0000 (22:53 -0700)]
Don't use a browser as the default browser if it's not installed

Add locations for the known browsers' binaries, and check to see if the
binary is installed before using a browser as the default.

13 years agoGet rid of boilerplate code in swb_config_free()
Steven Luo [Sun, 30 May 2010 05:20:24 +0000 (22:20 -0700)]
Get rid of boilerplate code in swb_config_free()

We can loop over swb_config_options[] instead of identifying every
string config option explicitly here.

13 years agoAvoid structure copies when looping through swb_config_options
Steven Luo [Sun, 30 May 2010 05:11:11 +0000 (22:11 -0700)]
Avoid structure copies when looping through swb_config_options

13 years agoRemove use_other_browser_cmd()
Steven Luo [Sun, 30 May 2010 04:37:28 +0000 (21:37 -0700)]
Remove use_other_browser_cmd()

use_other_browser_cmd() is only called from one place now, so just move
its code there and get rid of the function.

13 years agoUse an array of browser launchers instead of boilerplate code in update_default_browser()
Steven Luo [Sun, 30 May 2010 04:25:42 +0000 (21:25 -0700)]
Use an array of browser launchers instead of boilerplate code in update_default_browser()

Replace the existing set of if-elses comparing default_browser against
string constants with a loop over an array of browser launchers, which
will be (marginally) easier to maintain.

13 years agoUpdate webpage
Steven Luo [Sun, 30 May 2010 03:32:12 +0000 (20:32 -0700)]
Update webpage

13 years agoIntroduce command-line config utility
Steven Luo [Wed, 26 May 2010 14:52:17 +0000 (07:52 -0700)]
Introduce command-line config utility

Add a simple command-line configuration utility,
browser-switchboard-config, which can be used to query or set
browser-switchboard config settings.

The primary purpose of this tool is to allow browser vendors to provide
an option in their browsers to set themselves as the default browser,
via something like this (shell-like pseudocode):
if [ -x /usr/bin/browser-switchboard-config ]; then
if [ `browser-switchboard-config -b` = "mybrowser" ]; then
display "MyBrowser is the default browser."
else
button "Make MyBrowser the default browser" action "browser-switchboard-config -s -b mybrowser"
fi
else
display "Install Browser Switchboard to make MyBrowser the default browser"
fi
Browser vendors: setting yourself as the default browser without
prompting the user first (via package maintainer scripts, for example)
is strongly discouraged.

13 years agoIndentation fixes
Steven Luo [Wed, 26 May 2010 14:36:30 +0000 (07:36 -0700)]
Indentation fixes

13 years agoClean up configuration again
Steven Luo [Wed, 26 May 2010 11:06:30 +0000 (04:06 -0700)]
Clean up configuration again

Commit ec8b58af... ("Refactor configuration") still has too much
boilerplate code and leaves too many places that have to be modified to
add a new config option.

To fix this, add a new array of config options with name and type of
information stored, and then add an array of pointers to the elements of
struct swb_config with indices matching the list of config options to
struct swb_config.  This consolidates all the work needed to add new
config options to config.h and config.c, and allows us to replace the
boilerplate code with loops over the array of config options.

13 years agoRefactor configuration
Steven Luo [Tue, 25 May 2010 13:41:42 +0000 (06:41 -0700)]
Refactor configuration

Most of the code for loading configuration from the config file was
being duplicated between the UI and the main browser-switchboard code;
also, the forthcoming command-line configuration tool should share the
code for loading and saving configuration with the UI.  Therefore,
move code for loading and saving configuration information into
functions generic enough to be shared between the UIs and
browser-switchboard.

13 years agoAdd preliminary support for Opera Mobile
Steven Luo [Thu, 13 May 2010 09:19:23 +0000 (02:19 -0700)]
Add preliminary support for Opera Mobile

We do this the lazy way, using use_other_browser_cmd("opera %s").  The
Opera Labs post announcing Opera Mobile for Maemo
(http://labs.opera.com/news/2010/05/11/) says that "an extra empty tab
will get opened every time you open a link from an external
application", so I suspect we may need a different method of opening
links in an already open browser.

14 years agoWhitespace cleanups
Steven Luo [Mon, 8 Mar 2010 09:34:18 +0000 (01:34 -0800)]
Whitespace cleanups

14 years agoAvoid use of Fremantle codename alone, for clarity
Steven Luo [Wed, 24 Feb 2010 20:09:11 +0000 (12:09 -0800)]
Avoid use of Fremantle codename alone, for clarity

14 years agoUpdate webpage
Steven Luo [Wed, 24 Feb 2010 20:05:39 +0000 (12:05 -0800)]
Update webpage

14 years agoNote that on Fremantle, MicroB browser windows should be closed before installing
Steven Luo [Mon, 22 Feb 2010 12:13:41 +0000 (04:13 -0800)]
Note that on Fremantle, MicroB browser windows should be closed before installing

14 years agoRestore webpages
Steven Luo [Mon, 22 Feb 2010 10:00:55 +0000 (02:00 -0800)]
Restore webpages

This reverts commit 4426a6e201e88459830f194617af1d5dd14ed3ef.

14 years agoRemove webpages for release v3.2
Steven Luo [Mon, 22 Feb 2010 09:59:05 +0000 (01:59 -0800)]
Remove webpages for release

14 years agoUpdate Changelog
Steven Luo [Mon, 22 Feb 2010 09:41:42 +0000 (01:41 -0800)]
Update Changelog

14 years agoUpdate README
Steven Luo [Mon, 22 Feb 2010 09:29:00 +0000 (01:29 -0800)]
Update README

14 years agoRevert "Make startup notification work for MicroB menu entry"
Steven Luo [Mon, 22 Feb 2010 09:13:01 +0000 (01:13 -0800)]
Revert "Make startup notification work for MicroB menu entry"

This behaves very badly if you try to use the MicroB menu entry while
MicroB is already open (a new MicroB will open after you close the
MicroB).

This reverts commit 846e68b8ffa979d30ed331c43020212ffdee2bf2.

14 years agoMake startup notification work for MicroB menu entry
Steven Luo [Mon, 22 Feb 2010 04:53:46 +0000 (20:53 -0800)]
Make startup notification work for MicroB menu entry

To have working startup notification, we have to provide a D-Bus service
with a top_application method; hildon-desktop will then use that to
launch the application instead of invoking the binary directly.  Co-opt
the org.maemo.garage.browser_switchboard name previously used for
locking for this (replacing a - with a _ to get around D-Bus naming
restrictions).

While we're at it, remove the non-standard switchboard_launch_microb
method from the com.nokia.osso_browser interface we implement, instead
providing a launch_microb method in our own interface.

14 years agoLink binaries with -Wl,--as-needed to reduce library dependencies
Steven Luo [Mon, 22 Feb 2010 06:29:32 +0000 (22:29 -0800)]
Link binaries with -Wl,--as-needed to reduce library dependencies

Using pkg-config --libs to get library link lines has the disadvantage
of bringing in many more library dependencies than actually necessary,
since that assumes that dependencies of libraries need to be specified
explicitly at link time (even when the library is itself linked against
those dependencies).  Using GNU ld's --as-needed option causes these
unnecessary dependencies to be omitted from the binary.

--as-needed needs to be specified after all the objects to be linked
into the binary and before the libraries, so some reordering of the link
command line is needed.

14 years agoFix Makefile install targets
Steven Luo [Mon, 22 Feb 2010 06:19:01 +0000 (22:19 -0800)]
Fix Makefile install targets

The overhaul of the Makefile targets broke the dependencies of the
install targets; fix this (along with a broken strip target in
config-ui/Makefile).

14 years agoFix Makefile clean targets
Steven Luo [Mon, 22 Feb 2010 05:47:28 +0000 (21:47 -0800)]
Fix Makefile clean targets

Since we have a list of objects that we build already, use that in the
clean targets instead of *.o.  This fixes the config-ui Makefile clean
target, which was potentially missing ../configfile.plugin.o.

14 years agoUpdate build system
Steven Luo [Mon, 22 Feb 2010 05:37:12 +0000 (21:37 -0800)]
Update build system

As currently set up, it takes far too much external knowledge to
generate builds for Fremantle (a set of EXTRA_CPPFLAGS as well as
EXTRA_LDFLAGS); this is because the Makefiles were originally written
when there was only one target system (Diablo).

To fix this, provide new "diablo" and "fremantle" targets that can be
used to build the appropriate browser-switchboard without further
configuration, and make the "all" target print out a help message.  For
the config UI, provide new "fremantle-hildon-app" and "fremantle-plugin"
targets, and rename the existing targets to "diablo-hildon-app" and
"diablo-plugin" to match.

14 years agoMake "Web" menu entry and /usr/bin/browser open the default browser
Steven Luo [Sun, 21 Feb 2010 05:47:48 +0000 (21:47 -0800)]
Make "Web" menu entry and /usr/bin/browser open the default browser

Currently, no matter what the default browser is set to, the "Web" menu
entry opens MicroB, and running /usr/bin/browser does the same. This is
done to make sure that there's always a way of opening MicroB regardless
of the default browser setting.

However, this behavior would seem to be less than intuitive (why does
the entry marked "Web" not open the default browser? on Diablo, why do
the Web sidebar panel and Web menu entry do completely different
things?).  Therefore, do the following:

* Make the top_application method in the D-Bus interface open the
  default browser, not MicroB, and therefore make the "Web" menu entry
  open the default browser.
* Ship a new microb.desktop file which provides a MicroB menu entry that
  launches MicroB.
* Rename the existing /usr/bin/browser script to /usr/bin/microb.
* Ship a new /usr/bin/browser script which launches the default browser.

This has one primary disadvantage: none of the standard methods of
launching a browser on Maemo can be guaranteed to bring up MicroB (with
the old behavior, invoking /usr/bin/browser was guaranteed to bring up
MicroB, just as if Browser Switchboard weren't installed).

14 years agoMake config printout go to selected log target
Steven Luo [Sun, 21 Feb 2010 03:54:54 +0000 (19:54 -0800)]
Make config printout go to selected log target

The config printout that gets displayed on startup was happening before
log_config(), so it was always going to stdout regardless of the logging
setting.  Fix this.

14 years agoAdd a new config setting for logging
Steven Luo [Sun, 21 Feb 2010 03:26:48 +0000 (19:26 -0800)]
Add a new config setting for logging

Add a new config setting:
logging = "stdout" -- log to stdout (default)
logging = "syslog" -- log to syslog
logging = "none" -- disable logging
No configuration UI is exposed, but the UI needs to be taught that this
is a legal config setting (so that it doesn't discard it).

14 years agoConvert existing code to use the new logging infrastructure
Steven Luo [Sun, 21 Feb 2010 02:39:20 +0000 (18:39 -0800)]
Convert existing code to use the new logging infrastructure

14 years agoAdd logging functions with selectable log output targets
Steven Luo [Sun, 21 Feb 2010 02:13:28 +0000 (18:13 -0800)]
Add logging functions with selectable log output targets

Currently, our "logging" consists of a mix of printf(), perror(), and
other such calls which print output to stdout/stderr.  In normal usage,
browser-switchboard will be launched by D-Bus, which results in
stdout/stderr pointing to /dev/null and debugging output being lost.

To improve this situation, introduce a new set of logging functions
log_out() and log_perror(), and a log_config() which allows choosing the
log target.  These functions log to stdout by default, but also support
syslog output (to the LOG_USER facility, with priority LOG_DEBUG) and
disabling logging entirely.

Thanks to Faheem Pervez (qwerty12) for the suggestion.

14 years agoForce the Fremantle Ovi Store bookmark to open in MicroB
Steven Luo [Sat, 20 Feb 2010 01:19:29 +0000 (17:19 -0800)]
Force the Fremantle Ovi Store bookmark to open in MicroB

The Ovi Store apparently only comes up if you visit with MicroB, so
force the link in the Ovi Store bookmark to open in MicroB.

Reported by maemo.org talk user ToJa92; additional details provided by
Faheem Pervez (qwerty12).

14 years agoUpdate copyright year
Steven Luo [Tue, 16 Feb 2010 02:52:07 +0000 (18:52 -0800)]
Update copyright year

14 years agoClarify control flow in inotify read loop
Steven Luo [Tue, 16 Feb 2010 02:50:01 +0000 (18:50 -0800)]
Clarify control flow in inotify read loop

Replace pointer arithmetic that makes the loop condition false with a
simple break; functionally equivalent, but much clearer.

14 years agoEnsure that only one browser-switchboard is active at any time
Steven Luo [Mon, 15 Feb 2010 07:26:16 +0000 (23:26 -0800)]
Ensure that only one browser-switchboard is active at any time

When launching MicroB, during the window between the time we let go of
com.nokia.osso_browser and the time MicroB picks it up, it's possible
that some process issues a request for the interface, which causes D-Bus
to attempt to start another copy of browser-switchboard; the results are
confusing at best and (in the Fremantle case) disastrous at worst.
Prevent this by trying to acquire the name
org.maemo.garage.browser-switchboard from D-Bus on startup, in a manner
that succeeds if and only if no one else already owns the name.

This is important because the Fremantle hildon-desktop appears to
sometimes insist on having a process to own com.nokia.osso_browser at
all times; when it decides this is necessary, it picks up our release of
the name and immediately asks D-Bus to launch another
browser-switchboard, which gets in the way of our MicroB launching
procedure.

14 years agoAvoid a race between MicroB startup and establishing D-Bus watch for it
Steven Luo [Mon, 15 Feb 2010 01:58:53 +0000 (17:58 -0800)]
Avoid a race between MicroB startup and establishing D-Bus watch for it

As it stands, the establishment of the D-Bus match and filter for the
acquisition of com.nokia.osso_browser happens in parallel with MicroB
startup; as a result, it's possible that MicroB could acquire the name
before we're ready to look for the event, which results in us waiting
forever for MicroB to start (even though it's already started).  Avoid
this by establishing the watch before we fork a child process.

Possibly fixes a rare failure mode reported by Faheem Pervez (qwerty12).

14 years agoInstall the inotify watch for lockfile creation before forking
Steven Luo [Mon, 15 Feb 2010 01:28:54 +0000 (17:28 -0800)]
Install the inotify watch for lockfile creation before forking

This avoids the silliness of doing this in both the parent and child
process.

14 years agoTake a different approach to detecting MicroB browser window close
Steven Luo [Sun, 14 Feb 2010 04:55:19 +0000 (20:55 -0800)]
Take a different approach to detecting MicroB browser window close

As it turns out, the Fremantle IM/SMS application also spawns a
browserd; this browserd also attempts to claim the Mozilla.MicroB or
com.nokia.microb-engine D-Bus name, which means that we cannot count on
the MicroB browserd actually having ownership of this name.

Assuming that this D-Bus name is actually needed by anything else, this
is broken by design (since only one connection can own a name on the bus
at any time, and which browserd owns the name appears to be
nondeterministic); of course, I haven't observed any actual use of this
name in my testing either.  Who comes up with this stuff?!?!!?!

In any event, take a different approach to detecting when the MicroB
browserd closes: get the browserd PID from its profile lockfile, then
ptrace() the process to learn when it closes.  There are various
complications which make this more involved than we'd like, but this
should be a foolproof method of detecting the browserd close.

14 years agoUpdate webpage
Steven Luo [Sat, 6 Feb 2010 12:52:13 +0000 (04:52 -0800)]
Update webpage

14 years agoAvoid two consecutive parens in webpage text
Steven Luo [Sat, 6 Feb 2010 10:58:21 +0000 (02:58 -0800)]
Avoid two consecutive parens in webpage text

14 years agoUpdate Fremantle screenshot with new 3.1 UI
Steven Luo [Sat, 6 Feb 2010 10:56:37 +0000 (02:56 -0800)]
Update Fremantle screenshot with new 3.1 UI

14 years agoUpdate webpage
Steven Luo [Sat, 6 Feb 2010 10:55:20 +0000 (02:55 -0800)]
Update webpage

14 years agoKill MicroB browser UI processes instead of using exit_browser
Steven Luo [Sat, 6 Feb 2010 10:00:38 +0000 (02:00 -0800)]
Kill MicroB browser UI processes instead of using exit_browser

Reports from users suggest that the exit_browser method call currently
being used to close the MicroB browser UI processes may not be working
reliably.  Try a kill() instead, and hope that this doesn't introduce
data loss problems ...

14 years agoMake sure a running browserd is detected correctly on all devices
Steven Luo [Fri, 5 Feb 2010 12:32:01 +0000 (04:32 -0800)]
Make sure a running browserd is detected correctly on all devices

`pidof /usr/sbin/browserd` doesn't work on at least one user's device;
`pidof browserd` works everywhere without exception, so use that
instead.

Reported by Faheem Pervez (qwerty12).

14 years agoUpdate copyright year
Steven Luo [Fri, 5 Feb 2010 07:47:39 +0000 (23:47 -0800)]
Update copyright year

14 years agoThrow away stdout/stderr for browserds we launch too
Steven Luo [Fri, 5 Feb 2010 07:37:56 +0000 (23:37 -0800)]
Throw away stdout/stderr for browserds we launch too

Commit d8d8d1ed... ("Close stdin/stdout/stderr in child processes before
exec()") didn't prevent browserd from spewing noise, because we invoke
that via system() instead of fork()/exec().  Fix that oversight.

14 years agoFix some abuses of the D-Bus API
Steven Luo [Fri, 5 Feb 2010 07:32:27 +0000 (23:32 -0800)]
Fix some abuses of the D-Bus API

dbus_g_proxy_call() needs two G_TYPE_INVALIDs in the arguments, one to
terminate the list of input variables and one to terminate the list of
output variables.  This was causing an error, which we were ignoring;
now that we don't get an error every time, print the error message and
exit instead of continuing silently in the face of errors.

Also, make sure the dbus_g_proxy_new_for_name() call succeeds, instead
of potentially passing a NULL tear_proxy to dbus_g_proxy_call().

14 years agoClose stdin/stdout/stderr in child processes before exec()
Steven Luo [Fri, 5 Feb 2010 07:06:35 +0000 (23:06 -0800)]
Close stdin/stdout/stderr in child processes before exec()

stdout/stderr output from the browser processes we exec() is noisy,
useless, and getting in the way of our debugging output.  Fix this by
throwing it away.