remove use of deprecated netsurf_quit variable in beos

The core no longer needs to run the event polling loop as fetches are now
scheduler driven. This is part of a series which will ultimately remove
netsurf_poll callback altogether.
This commit is contained in:
François Revol 2014-10-13 01:15:44 +02:00
parent a726860d4e
commit 34fdedba78
4 changed files with 17 additions and 7 deletions

View File

@ -84,6 +84,8 @@ static void *myrealloc(void *ptr, size_t len, void *pw);
// enable using resources instead of files
#define USE_RESOURCES 1
bool nsbeos_done = false;
bool replicated = false; /**< if we are running as a replicant */
char *options_file_location;
@ -713,7 +715,7 @@ void nsbeos_pipe_message_top(BMessage *message, BWindow *_this, struct beos_scaf
}
static void gui_poll(bool active)
void nsbeos_gui_poll(void)
{
fd_set read_fd_set, write_fd_set, exc_fd_set;
int max_fd;
@ -978,7 +980,7 @@ static struct gui_fetch_table beos_fetch_table = {
};
static struct gui_browser_table beos_browser_table = {
gui_poll,
NULL, //nsbeos_gui_poll,
beos_schedule,
gui_quit,
gui_launch_url,
@ -1038,7 +1040,9 @@ int main(int argc, char** argv)
gui_init(argc, argv);
netsurf_main_loop();
while (!nsbeos_done) {
nsbeos_gui_poll();
}
netsurf_exit();

View File

@ -29,12 +29,15 @@
#define CALLED() fprintf(stderr, "%s()\n", __FUNCTION__);
extern bool nsbeos_done;
extern bool replicated;
int gui_init_replicant(int argc, char** argv);
extern "C" void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw);
extern "C" void nsbeos_gui_poll(void);
extern char *options_file_location;

View File

@ -754,7 +754,10 @@ int32 nsbeos_replicant_main_thread(void *_arg)
struct replicant_thread_info *info = (struct replicant_thread_info *)_arg;
int32 ret = 0;
netsurf_main_loop();
while (!nsbeos_done) {
nsbeos_gui_poll();
}
netsurf_exit();
delete info;
delete_sem(replicant_done_sem);
@ -769,7 +772,7 @@ static void nsbeos_window_destroy_event(NSBrowserWindow *window, nsbeos_scaffold
LOG(("Being Destroyed = %d", g->being_destroyed));
if (--open_windows == 0)
netsurf_quit = true;
nsbeos_done = true;
if (window) {
window->Lock();
@ -1275,7 +1278,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
}
break;
case APPLICATION_QUIT:
netsurf_quit = true;
nsbeos_done = true;
break;
default:
break;

View File

@ -456,7 +456,7 @@ void nsbeos_dispatch_event(BMessage *message)
switch (message->what) {
case B_QUIT_REQUESTED:
// from the BApplication
netsurf_quit = true;
nsbeos_done = true;
break;
case B_ABOUT_REQUESTED:
{