diff options
author | François Revol <revol@free.fr> | 2012-11-25 19:47:48 +0100 |
---|---|---|
committer | François Revol <revol@free.fr> | 2012-11-25 19:47:48 +0100 |
commit | 38b17e11123d7da014d6c53c28f3d181a15517eb (patch) | |
tree | b2585120f3b428f9a6cec25ebb4772bb929eb886 /beos/gui.cpp | |
parent | 8a12a8d5459a0fff8cd2e7f424300b71ec733feb (diff) | |
download | netsurf-38b17e11123d7da014d6c53c28f3d181a15517eb.tar.gz netsurf-38b17e11123d7da014d6c53c28f3d181a15517eb.tar.bz2 |
beos: Partial replicant instanciation fix
* use the correct resources
* work around a deadlock, allows BeHappy to start, though removing
the replicant from Tracker crashes
Diffstat (limited to 'beos/gui.cpp')
-rw-r--r-- | beos/gui.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp index 9e26d44ff..dacdee909 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -457,6 +457,12 @@ int main(int argc, char** argv) options.Append("x-vnd.NetSurf"); } + if (!replicated) { + // create the Application object before trying to use messages + // so we can open an alert in case of error. + new NSBrowserApplication; + } + char* messages = "/boot/apps/netsurf/res/en/Messages"; /* initialise netsurf */ @@ -472,6 +478,27 @@ int main(int argc, char** argv) return 0; } +/** called when replicated from NSBaseView::Instantiate() */ +int gui_init_replicant(int argc, char** argv) +{ + setbuf(stderr, NULL); + + BPath options; + if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) { + options.Append("x-vnd.NetSurf"); + } + + char* messages = "/boot/apps/netsurf/res/en/Messages"; + + /* initialise netsurf */ + netsurf_init(&argc, &argv, options.Path(), messages); + + gui_init(argc, argv); + gui_init2(argc, argv); + + return 0; +} + /* Documented in desktop/options.h */ void gui_options_init_defaults(void) { @@ -487,7 +514,6 @@ void gui_init(int argc, char** argv) if (pipe(sEventPipe) < 0) return; if (!replicated) { - new NSBrowserApplication; sBAppThreadID = spawn_thread(bapp_thread, "BApplication(NetSurf)", B_NORMAL_PRIORITY, (void *)find_thread(NULL)); if (sBAppThreadID < B_OK) return; /* #### handle errors */ |