From 3f66586110a8421bfbbb1e73036a4b9dc1aaa744 Mon Sep 17 00:00:00 2001 From: vl Date: Fri, 24 Sep 2010 17:07:17 +0200 Subject: [PATCH] Fixed: #1033 WebIG now works on linux too --- .../client/src/interface_v3/group_html.cpp | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index fb8c9c268..3ea937fa3 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -2592,6 +2592,34 @@ struct CButtonFreezer : public CInterfaceElementVisitor } }; +static int timer_called = 0; + +static int +timer_callback(HTTimer * const timer , + void * const user_data , + HTEventType const event ) { +/*---------------------------------------------------------------------------- + A handy timer callback which cancels the running event loop. +-----------------------------------------------------------------------------*/ + nlassert(event == HTEvent_TIMEOUT); + timer_called = 1; + HTEventList_stopLoop(); + + /* XXX - The meaning of this return value is undocumented, but close + ** inspection of libwww's source suggests that we want to return HT_OK. */ + return HT_OK; +} + +static void handleLibwwwEvents() { + HTTimer *timer; + timer_called = 0; + timer = HTTimer_new(NULL, &timer_callback, NULL, + 1, YES, NO); + if (!timer_called) + HTEventList_newLoop(); + HTTimer_delete(timer); +} + // *************************************************************************** void CGroupHTML::handle () @@ -2871,6 +2899,10 @@ void CGroupHTML::handle () } } } +#ifndef NL_OS_WINDOWS + if(isBrowsing()) + handleLibwwwEvents(); +#endif } // ***************************************************************************