Merge remote-tracking branch 'origin/mmu_man/beos-fixes'

This commit is contained in:
Daniel Silverstone (parasomnia chroot) 2013-03-22 08:08:36 +00:00
commit b23c580f33
3 changed files with 16 additions and 9 deletions

View File

@ -542,7 +542,7 @@ ifeq ($(TARGET),beos)
$(Q)$(BEOS_SETVER) $(EXETARGET) \
-app $(VERSION_MAJ) $(VERSION_MIN) 0 d 0 \
-short "NetSurf $(VERSION_FULL)" \
-long "NetSurf $(VERSION_FULL) © 2003 - 2012 The NetSurf Developers"
-long "NetSurf $(VERSION_FULL) © 2003 - 2013 The NetSurf Developers"
$(VQ)echo " MIMESET: $(EXETARGET)"
$(Q)$(BEOS_MIMESET) $(EXETARGET)
endif

View File

@ -141,11 +141,12 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
font.GetEscapements(string, len, escapements);
// slow but it should work
for (i = 0; string[index] && i < len; i++) {
if (x < current)
break;
esc += escapements[i];
current = font.Size() * esc;
index += utf8_char_len(&string[index]);
// is current char already too far away?
if (x < current)
break;
}
*actual_x = (int)current;
*char_offset = i; //index;

View File

@ -142,6 +142,7 @@ struct replicant_thread_info {
static int open_windows = 0; /**< current number of open browsers */
static NSBaseView *replicant_view = NULL; /**< if not NULL, the replicant View we are running NetSurf for */
static sem_id replicant_done_sem = -1;
static thread_id replicant_thread = -1;
static void nsbeos_window_update_back_forward(struct beos_scaffolding *);
static void nsbeos_throb(void *);
@ -224,9 +225,14 @@ NSBaseView::NSBaseView(BMessage *archive)
NSBaseView::~NSBaseView()
{
//warn_user ("~NSBaseView()", NULL);
BMessage *message = new BMessage(B_QUIT_REQUESTED);
nsbeos_pipe_message_top(message, NULL, fScaffolding);
while (acquire_sem(replicant_done_sem) == EINTR);
if (replicated) {
BMessage *message = new BMessage(B_QUIT_REQUESTED);
nsbeos_pipe_message_top(message, NULL, fScaffolding);
while (acquire_sem(replicant_done_sem) == EINTR);
//debugger("plop");
status_t status = -1;
wait_for_thread(replicant_thread, &status);
}
}
@ -397,15 +403,15 @@ NSBaseView::Instantiate(BMessage *archive)
gui_init_replicant(2, info->args);
replicant_done_sem = create_sem(0, "NS Replicant created");
thread_id nsMainThread = spawn_thread(nsbeos_replicant_main_thread,
replicant_thread = spawn_thread(nsbeos_replicant_main_thread,
"NetSurf Main Thread", B_NORMAL_PRIORITY, info);
if (nsMainThread < B_OK) {
if (replicant_thread < B_OK) {
delete_sem(replicant_done_sem);
delete info;
delete view;
return NULL;
}
resume_thread(nsMainThread);
resume_thread(replicant_thread);
//XXX: deadlocks BeHappy
//while (acquire_sem(replicant_done_sem) == EINTR);