summaryrefslogtreecommitdiff
path: root/beos
diff options
context:
space:
mode:
Diffstat (limited to 'beos')
-rw-r--r--beos/gui.cpp30
-rw-r--r--beos/window.cpp54
-rw-r--r--beos/window.h1
3 files changed, 30 insertions, 55 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp
index f9e02d0de..84f397b0b 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -713,7 +713,6 @@ static void gui_poll(bool active)
int max_fd;
struct timeval timeout;
unsigned int fd_count = 0;
- bool block = true;
bigtime_t next_schedule = 0;
/* get any active fetcher fd */
@@ -728,34 +727,23 @@ static void gui_poll(bool active)
/** @todo Check if this max_fd should have + 1 */
max_fd = MAX(max_fd, sEventPipe[0] + 1);
- // If there are pending events elsewhere, we should not be blocking
- if (!browser_reformat_pending) {
- if (earliest_callback_timeout != B_INFINITE_TIMEOUT) {
- next_schedule = earliest_callback_timeout - system_time();
- block = false;
- }
-
- // we're quite late already...
- if (next_schedule < 0)
- next_schedule = 0;
-
- } else {//we're not allowed to sleep, there is other activity going on.
- nsbeos_window_process_reformats();
- block = false;
+ // compute schedule timeout
+ if (earliest_callback_timeout != B_INFINITE_TIMEOUT) {
+ next_schedule = earliest_callback_timeout - system_time();
+ } else {
+ next_schedule = earliest_callback_timeout;
}
- /*
- LOG(("gui_poll: browser_reformat_pending:%d earliest_callback_timeout:%Ld"
- " next_schedule:%Ld block:%d ", browser_reformat_pending,
- earliest_callback_timeout, next_schedule, block));
- */
+ // we're quite late already...
+ if (next_schedule < 0)
+ next_schedule = 0;
timeout.tv_sec = (long)(next_schedule / 1000000LL);
timeout.tv_usec = (long)(next_schedule % 1000000LL);
//LOG(("gui_poll: select(%d, ..., %Ldus", max_fd, next_schedule));
fd_count = select(max_fd, &read_fd_set, &write_fd_set, &exc_fd_set,
- block ? NULL : &timeout);
+ &timeout);
//LOG(("select: %d\n", fd_count));
if (fd_count > 0 && FD_ISSET(sEventPipe[0], &read_fd_set)) {
diff --git a/beos/window.cpp b/beos/window.cpp
index 8975c1871..d27bca758 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -883,9 +883,7 @@ void nsbeos_window_resize_event(BView *view, gui_window *g, BMessage *event)
width++;
height++;
-
- g->bw->reformat_pending = true;
- browser_reformat_pending = true;
+ browser_window_schedule_reformat(g->bw);
return;
}
@@ -901,51 +899,40 @@ void nsbeos_window_moved_event(BView *view, gui_window *g, BMessage *event)
//view->Invalidate(view->Bounds());
view->UnlockLooper();
- //g->bw->reformat_pending = true;
- //browser_reformat_pending = true;
-
-
return;
}
void nsbeos_reflow_all_windows(void)
{
- for (struct gui_window *g = window_list; g; g = g->next)
- g->bw->reformat_pending = true;
-
- browser_reformat_pending = true;
+ for (struct gui_window *g = window_list; g; g = g->next) {
+ browser_window_schedule_reformat(g->bw);
+ }
}
+
/**
- * Process pending reformats
+ * callback from core to reformat a window.
*/
-
-void nsbeos_window_process_reformats(void)
+static void beos_window_reformat(struct gui_window *g)
{
- struct gui_window *g;
-
- browser_reformat_pending = false;
- for (g = window_list; g; g = g->next) {
- NSBrowserFrameView *view = g->view;
- if (!g->bw->reformat_pending)
- continue;
- if (!view || !view->LockLooper())
- continue;
- g->bw->reformat_pending = false;
- BRect bounds = view->Bounds();
- view->UnlockLooper();
+ if (g == NULL) {
+ return;
+ }
+
+ NSBrowserFrameView *view = g->view;
+ if (view && view->LockLooper()) {
+ BRect bounds = view->Bounds();
+ view->UnlockLooper();
#warning XXX why - 1 & - 2 !???
- browser_window_reformat(g->bw,
- false,
- bounds.Width() + 1 /* - 2*/,
- bounds.Height() + 1);
- }
-
+ browser_window_reformat(g->bw,
+ false,
+ bounds.Width() + 1 /* - 2*/,
+ bounds.Height() + 1);
+ }
}
-
void nsbeos_window_destroy_browser(struct gui_window *g)
{
browser_window_destroy(g->bw);
@@ -1356,6 +1343,7 @@ static struct gui_window_table window_table = {
gui_window_set_scroll,
gui_window_get_dimensions,
gui_window_update_extent,
+ beos_window_reformat,
/* from scaffold */
gui_window_set_title,
diff --git a/beos/window.h b/beos/window.h
index fb67517d2..0e38d88ed 100644
--- a/beos/window.h
+++ b/beos/window.h
@@ -51,7 +51,6 @@ void nsbeos_dispatch_event(BMessage *message);
void nsbeos_reflow_all_windows(void);
-void nsbeos_window_process_reformats(void);
nsbeos_scaffolding *nsbeos_get_scaffold(struct gui_window *g);
struct browser_window *nsbeos_get_browser_for_gui(struct gui_window *g);