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.
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.
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.
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.
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.
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.