DEV-49389 (SNOW-571 / VWR-18279): Replacing another deprecated WaitNextEvent() for the OS X 10.6 SDK

Replaced the deprecated WaitNextEvent() call with ReceiveNextEvent() and SendEventToEventTarget() as a basic event loop in slplugin.cpp
master
Aimee Linden 2010-04-25 03:49:55 +01:00
parent f758852266
commit 0cdaca2b46
1 changed files with 9 additions and 2 deletions

View File

@ -255,6 +255,9 @@ int main(int argc, char **argv)
}
#endif
#if LL_DARWIN
EventTargetRef event_target = GetEventDispatcherTarget();
#endif
while(!plugin->isDone())
{
timer.reset();
@ -262,8 +265,12 @@ int main(int argc, char **argv)
#if LL_DARWIN
{
// Some plugins (webkit at least) will want an event loop. This qualifies.
EventRecord evt;
WaitNextEvent(0, &evt, 0, NULL);
EventRef event;
if(ReceiveNextEvent(0, 0, kEventDurationNoWait, true, &event) == noErr)
{
SendEventToEventTarget (event, event_target);
ReleaseEvent(event);
}
// Check for a change in this process's frontmost window.
if(FrontWindow() != front_window)